<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sgt. Conker</title>
	<atom:link href="http://www.sgtconker.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sgtconker.com</link>
	<description>We are &#34;absolutely fine&#34;</description>
	<lastBuildDate>Thu, 11 Mar 2010 02:31:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>More on XNA Game Studio 4.0 and Windows Phone Support</title>
		<link>http://www.sgtconker.com/2010/03/more-on-xna-game-studio-4-0-and-windows-phone-support/</link>
		<comments>http://www.sgtconker.com/2010/03/more-on-xna-game-studio-4-0-and-windows-phone-support/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 21:39:42 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Windows Phone 7 Series]]></category>
		<category><![CDATA[WP7Dev]]></category>
		<category><![CDATA[XNA 4.0]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/03/more-on-xna-game-studio-4-0-and-windows-phone-support/</guid>
		<description><![CDATA[Says the Klucher through the tweets of The Shawn:
Demo [Harvest, developed by Luma Arcade] looks awesome, full 3D, animating characters. More will be shown at MIX next week.
The game loop on the phone is similar to existing platforms, but tweaked for power efficiency.
The phone graphics is an evolution of the existing immediate mode rendering API, [...]]]></description>
			<content:encoded><![CDATA[<p>Says the <a href="http://klucher.com/">Klucher</a> through the tweets of <a href="http://twitter.com/shawnhargreaves/">The Shawn</a>:</p>
<p>Demo <em>[Harvest, developed by Luma Arcade]</em> looks awesome, full 3D, animating characters. More will be shown at <a href="http://live.visitmix.com/">MIX next week</a>.</p>
<p>The game loop on the phone is similar to existing platforms, but tweaked for power efficiency.</p>
<p>The phone graphics is an evolution of the existing immediate mode rendering API, 2D and 3D:</p>
<ul>
<li>New configurable effects: BasicEffect, SkinnedEffect, EnvironmentMapEffect, DualTextureEffect, AlphaTestEffect </li>
<li>Custom programmable shaders <em>are <strong>not</strong> </em>supported on the phone </li>
<li>Image scaler:
<ul>
<li>lets you render to any size backbuffer, and have this automatically scaled to fill the screen </li>
<li>lets the same game run on both 800x480 and 480x320 display sizes without special coding </li>
<li>provides automatic rotation to support portrait, landscape left, and landscape right modes </li>
<li>the image scaler is free: it uses dedicated hardware so does not consume any GPU </li>
</ul>
</li>
</ul>
<p>Portability: the ability to target three screens. Portability lets you target more sockets with a smaller time investment. Portability is not just about the same game running on different platforms, it is also valuable to share infrastructure, knowledge, etc.</p>
<p>Framework feature profiles:</p>
<ul>
<li>Reach: broad base of devices including phones </li>
<li>HiDef: Windows and Xbox only </li>
</ul>
<p>“Focus on being a game developer, not plumbing the underlying technology”</p>
<p>“<a href="http://klucher.com/">Michael Klucher</a> plugs <a href="http://forums.xna.com/">forums.xna.com</a>, says our MVP's are awesome and do a great job answering questions.”</p>
<p>“<a href="http://klucher.com/">Michael Klucher</a> gets applause!”</p>
<p>The will be more talk about the Marketplace and the Windows Phone emulator at the <a href="http://live.visitmix.com/">MIX next week</a>.</p>
<p>XACT is part of the HiDef feature profile, so not on the phone: use SoundEffect (+ 4.0 enhancements) on the phone.</p>
<p><a href="http://www.ozymandias.com">Ozymandias</a> has <a href="http://www.ozymandias.com/it-has-begun-first-sessions-on-developing-games-for-windows-phone-at-gdc">an article about how to get in touch with Microsoft</a> to get access to Xbox LIVE on the phone.</p>
<p><strong>Update (2010-03-11 02:31 GMT):</strong> The Shawn has another blog post up, <a href="http://blogs.msdn.com/shawnhar/archive/2010/03/10/xna-game-studio-on-windows-phone.aspx">high-level-detailing some Windows Phone support related work done</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/more-on-xna-game-studio-4-0-and-windows-phone-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XNA Game Studio 4.0!</title>
		<link>http://www.sgtconker.com/2010/03/xna-game-studio-4-0/</link>
		<comments>http://www.sgtconker.com/2010/03/xna-game-studio-4-0/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 17:44:23 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/03/xna-game-studio-4-0/</guid>
		<description><![CDATA[…will bewas [Ed. how got that through?] announced at GDC 2010. What’s known so far:

Hardware accelerated 3D API’s on Windows Phone 7 Series [Ed. notice the lack of Zune HD in there…] 
Visual Studio 2010 integration with our toolset [Ed. what a surprise…] 
Added buffered audio support to the Audio API’s [Ed. could be interesting…] [...]]]></description>
			<content:encoded><![CDATA[<p>…<del>will be</del><add>was</add> <em>[Ed. how got that through?]</em> <a href="http://creators.xna.com/en-US/news/gdc2010">announced at GDC 2010</a>. What’s known so far:</p>
<ul>
<li>Hardware accelerated 3D API’s on Windows Phone 7 Series <em>[Ed. notice the lack of Zune HD in there…]</em> </li>
<li>Visual Studio 2010 integration with our toolset <em>[Ed. what a surprise…]</em> </li>
<li>Added buffered audio support to the Audio API’s <em>[Ed. could be interesting…]</em> </li>
</ul>
<p><strong>Update:</strong> Michael Klucher has a somewhat <a href="http://klucher.com/blog/achievement-unlocked-xna-game-studio-4-0-for-windows-phone/">more wordy version up on his blog</a>. From what it seems:</p>
<ul>
<li>Xbox LIVE API on Windows Phone 7 Series seems to be available to Xbox LIVE partners only (did anyone actually expect it to be open to everyone?) </li>
<li>The dead born Zune and Zune HD support will stay in XNA GS 3.1 (R.I.P.) </li>
<li>The buffered audio support is said to have been requested by lots of users; I wonder if that means <em>runtime writable</em> buffers… </li>
</ul>
<p><strong>Update 2:</strong> The <a href="http://creators.xna.com/en-US/press/gdc2010">GDC 2010 press release is on the XNA Creators Club Online site now</a>.</p>
<p><strong>Update 3:</strong> …which seems to indicate that XNA Game Studio 4.0 is for Windows Phone 7 Series only? Oh Microsoft, if someone really can confuse its customers than it is you…</p>
<p><strong>Update 4:</strong> …but that seems to be <em>Very Bad Wording</em> (in the FAQ) only.</p>
<p><strong>Update 5:</strong> <a href="http://blogs.msdn.com/shawnhar/archive/2010/03/09/in-which-hints-become-facts-xna-game-studio-4-0.aspx">The Shawn to the rescue with some more details</a>:</p>
<ul>
<li>New platform
<ul>
<li>Windows Phone 7 Series </li>
</ul>
</li>
<li>New features
<ul>
<li>Integrates with Visual Studio 2010 </li>
<li>Dynamic audio output <em>[Ed. Hui]</em> </li>
<li>Microphone input <em>[Ed. necessary for the phone side of things, eh?]</em> </li>
<li>BasicEffect has four new siblings <em>[Ed. or the mutant samples]</em>
<ul>
<li>SkinnedEffect </li>
<li>EnvironmentMapEffect </li>
<li>DualTextureEffect </li>
<li>AlphaTestEffect </li>
</ul>
</li>
</ul>
</li>
<li>Improved portability and usability
<ul>
<li>Collapsed graphics caps into just two profile levels: <em>Reach</em> and <em>HiDef</em> <em>[Ed. that’s nice]</em> </li>
<li>Many graphics API improvements <em>[Ed. We demand details!]</em> </li>
<li>This involves some breaking API changes <em>[Ed. We do not care (too much) about that!]</em> </li>
<li>Split Microsoft.Xna.Framework.dll into several assemblies, to make it more obvious which pieces are available on each platform <em>[Ed. this could be a bit of a concern]</em> </li>
</ul>
</li>
</ul>
<p><strong>Update 6:</strong> I might as well add some <a href="http://blogs.technet.com/microsoft_blog/archive/2010/03/09/game-developers-have-a-great-opportunity-with-windows-phone-7-series.aspx">tidbits about the marketplace to come</a>: </p>
<blockquote cite="http://blogs.technet.com/microsoft_blog/archive/2010/03/09/game-developers-have-a-great-opportunity-with-windows-phone-7-series.aspx"><p><strong>Windows® Phone Marketplace hub:</strong> But we also remain committed to independent developers. Windows Phone 7 Series includes the Windows® Phone Marketplace hub, where apps and games will be sold. Both independent and professional developers can offer games as apps via Marketplace, giving consumers a wide array of games to choose from. Charlie Kindle, the partner group program manager for Windows Phone 7 Series, <a href="http://blogs.msdn.com/ckindel/archive/2010/03/04/different-means-better-with-the-new-windows-phone-developer-experience.aspx">talked a little more about this in a blog post last week</a>.</p>
</blockquote>
<p><strong>Update 7:</strong> How could I even forgot to share the release date? “XNA Game Studio 4.0 will be available in the coming month, so get ready to jump on board!” (quoted from the press release)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/xna-game-studio-4-0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Silver Sprite 3.0 Alpha 2</title>
		<link>http://www.sgtconker.com/2010/03/silver-sprite-3-0-alpha-2/</link>
		<comments>http://www.sgtconker.com/2010/03/silver-sprite-3-0-alpha-2/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 09:39:03 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[SilverSprite]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1254</guid>
		<description><![CDATA[
Bill "Silent Assasin" Reiss has brought word of an Alpha 2 build of SilverSprite 3.0. You can grab the source and start playing with it right away
http://silversprite.codeplex.com/
SilverSprite enables you to get your XNA game working inside Silverlight with minimal fuss. It's worth checking out and if you're interested in Windows Phone 7 development, then this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sgtconker.com/wp-content/uploads/2010/03/silversprite.gif"><img class="alignnone size-full wp-image-1255" title="silversprite" src="http://www.sgtconker.com/wp-content/uploads/2010/03/silversprite.gif" alt="" width="341" height="84" /></a></p>
<p>Bill "Silent Assasin" Reiss has brought word of an Alpha 2 build of SilverSprite 3.0. You can grab the source and start playing with it right away<br />
<a href="http://silversprite.codeplex.com/">http://silversprite.codeplex.com/</a></p>
<p>SilverSprite enables you to get your XNA game working inside Silverlight with minimal fuss. It's worth checking out and if you're interested in Windows Phone 7 development, then this is an ideal starting point.</p>
<p>Here's a recent blog post discussing the Alpha in a little more detail. <a href="http://blogs.silverarcade.com/silverlight-games-101/08/silverlight-silversprite-not-just-for-xna-games-any-more/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed:+SilverlightGames101+(Silverlight+Games+101)">Read More</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/silver-sprite-3-0-alpha-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KiloWatt Animation for XNA</title>
		<link>http://www.sgtconker.com/2010/03/kilowatt-animation-for-xna/</link>
		<comments>http://www.sgtconker.com/2010/03/kilowatt-animation-for-xna/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 22:52:40 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[KiloWatt Animation]]></category>
		<category><![CDATA[Skinning]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1247</guid>
		<description><![CDATA[
Jwatte has tweeted news prediction of a new version of his KiloWatt animation library and Pre-release bits are here.
"This is the third-and-a-half release of the KiloWatt Animation library. It is intended as a companion to the kW X-port 3ds Max X file exporter, to be used with Microsoft XNA Game Studio. This release is for version [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="KiloWatt Animation Library" src="http://www.enchantedage.com/sites/default/files/xna-animation.jpg" alt="" width="371" height="220" /><br />
<a href="http://www.enchantedage.com">Jwatte</a> has tweeted <a href="http://twitter.com/jwatte/status/10139628721">news</a> prediction of a new version of his KiloWatt animation library and Pre-release bits are <a href="http://www.enchantedage.com/xna-animation">here</a>.</p>
<p><em>"This is the third-and-a-half release of the KiloWatt Animation library. It is intended as a companion to the kW X-port 3ds Max X file exporter, to be used with Microsoft XNA Game Studio. This release is for version 3.0/3.1 for Windows and Xbox 360. Sorry, no Zune support <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> "</em></p>
<p>He goes on to explain how this is different to the XNA Skinning sample on the creators website</p>
<p><em>The KiloWatt Animation Library is different from the XNA Skinning sample code in several ways, including:</em></p>
<ul>
<li><em>KiloWatt Animation stores animation keyframes as position, rotation and scale (for a total of 10 floats), instead of the full matrix used by the Animation Components.</em></li>
<li><em>KiloWatt Animation removes unnecessary keyframes (down to a tolerance that you can specify), for a usually quite significant savings in file size.</em></li>
<li><em>KiloWatt Animation does interpolation between animation keyframes using quaternions, which means that slow-motion and varispeed playback will still look smooth.</em></li>
<li><em>KiloWatt Animation supports composition (blending) of animations to generate the final output pose for a given Model.</em></li>
<li><em>KiloWatt Animation replaces the Effect used for your Model only when you tell it to.</em></li>
<li><em>KiloWatt Animation does not make any specific demands of your geometry; you can (and should) use it to animate rigid objects such as windmills, catapults etc. in addition to skinned meshes.</em></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/kilowatt-animation-for-xna/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Article: Draw me a line (Zune HD)</title>
		<link>http://www.sgtconker.com/2010/03/article-draw-me-a-line-zune-hd/</link>
		<comments>http://www.sgtconker.com/2010/03/article-draw-me-a-line-zune-hd/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 16:43:11 +0000</pubDate>
		<dc:creator>Sgt. Conker</dc:creator>
				<category><![CDATA[2D]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Touch]]></category>
		<category><![CDATA[XNA]]></category>
		<category><![CDATA[ZuneHD]]></category>
		<category><![CDATA[Zune HD]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1236</guid>
		<description><![CDATA[by Sgt. Conker

This article will show you how to create a dotted line based on touch input from the Zune HD.
This can be very useful for indicating to the user a path a game entity is going to take.
If you've ever played Flight Control for the iPhone you'll know exactly what I mean.

Firstly, if we [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">by <a href="http://www.conkerjo.com/">Sgt. Conker</a></h4>
<p><a href="http://www.sgtconker.com/wp-content/uploads/2010/03/bots.png"><img src="http://www.sgtconker.com/wp-content/uploads/2010/03/bots-300x169.png" alt="" title="bots" width="300" height="169" class="alignright size-medium wp-image-1240" /></a></p>
<p>This article will show you how to create a dotted line based on touch input from the Zune HD.<br />
This can be very useful for indicating to the user a path a game entity is going to take.<br />
If you've ever played <a href="http://www.iphonehacks.com/images/09-Apr/flight-control-iphone-app-1.jpg">Flight Control</a> for the iPhone you'll know exactly what I mean.</p>
<p><span id="more-1236"></span></p>
<p>Firstly, if we were doing this in a real game, we would most likely have some sort of engine.<br />
I've built this sample with a very small Micro Engine. This Micro Engine simply contains a list of World Entities and with each update/draw call it loops through each entity requesting it to update and draw.<br />
The Micro Engine has a main MicroEngine class and an Entity class which holds position/size/texture etc.</p>
<p>I won't explain this in detail here as it's out of scope of the article.</p>
<p>The first thing we should do, is make this work with a mouse on Windows. This will help us develop the feature much faster and we will add Zune HD touch input later.</p>
<p>Because we're using SpriteBatch, we'll also need a texture to use as the dotted line. Our texture will be one of the dashes and we will draw it multiple times to form a dotted line. This texture looks like this</p>
<p>In our main game loop we first call update to the MicroEngine class so that it can update the mouse input state.</p>
<pre class="brush: csharp;">this.engine.Update(gameTime);</pre>
<p>Next we need to detect that there has been a new touch from the mouse. Our engine contains a WasNewTouch method which checks the last and current state of the mouse to provide the result.</p>
<pre class="brush: csharp;">
if (engine.WasNewTouch())
{
</pre>
<p>If there was a new touch we want to start drawing a new dotted line. I've created a custom Entity so that we can utilise the MicroEngine.<br />
Inside this custom entity which I named CustomLineEntity, we store a list of Vector2 items to reference as each dot in the line.</p>
<pre class="brush: csharp;">
public class CustomLineEntity : Entity
{
    public List&lt;Vector2&gt; Points { get; set; }

    public CustomLineEntity()
    {
        this.Points = new List&lt;Vector2&gt;();
    }
</pre>
<p>We then want to override the simple draw method of a world entity and loop through our points and draw each one.</p>
<pre class="brush: csharp;">
public override void Draw(SpriteBatch spriteBatch)
{
    for (int index = 0; index &lt; this.Points.Count; index++)
    {
        this.DrawIndex(spriteBatch, index);
    }
}
</pre>
<p>To actually draw the dot in the line, we need to work out the rotation of the dot so that it's a smooth curvy line as we draw. It's also done in the draw section so that the line can be adaptive, it's not always known what rotation the first or last items would be until the line is complete.</p>
<pre class="brush: csharp;">
private void DrawIndex(SpriteBatch spriteBatch, int index)
{
    var item = this.Points[index];
    float rotation = 0;
    Vector2 heading = Vector2.Zero;

    if (index &lt; this.Points.Count - 1)
    {
        // Get the direction of this index from the next one in the list.
        heading = this.Points[index + 1]- item;
    }
    else if (this.Points.Count &gt; 1)
    {
        // It's the last one so get the direction of this index from the previous one in the list.
        heading = this.Points[index - 1]- item;
    }

    float angle = (float)Math.Atan2(heading.Y, heading.X);
    rotation = angle;
</pre>
<p>And then simply draw the sprite at the correct position and angle.</p>
<pre class="brush: csharp;">
Vector2 origin = new Vector2(this.Texture.Width / 2, this.Texture.Height / 2);
spriteBatch.Draw(
                this.Texture,
                item,
                null,
                Color.White,
                rotation,
                origin,
                1,
                SpriteEffects.None,
                0);
</pre>
<p>Going back to the main game loop, we detected a new touch with</p>
<pre class="brush: csharp;">
if (engine.WasNewTouch())
{
</pre>
<p>Now we can create the new CustomLineEntity and give it a starting position.<br />
We also set a pickedUp flag so that we know we're in the drawing a new line state.</p>
<pre class="brush: csharp;">
   // Start the line dragging by adding a CustomLineEntity to the engines WorldEntities
   this.pickedUp = true;

   this.currentLine = new CustomLineEntity();
   this.currentLine.Texture = dot;
   this.currentLine.Position = engine.MousePosition;
   this.currentLine.Points.Add(new Vector2(engine.MousePosition.X, engine.MousePosition.Y));
   this.engine.WorldEntities.Add(this.currentLine);
}
</pre>
<p>Adding it to the WorldEntities ensures it will receive the Draw &amp; Update method calls.</p>
<p>Still in our main game update.<br />
We need to detect when the user lifts off so that we can end the drawing of the line.<br />
To make this a little more fun, we will add a bot into the game world which will follow the newly created line. We will describe the bot a little later, for now, we'll just add it to the world.</p>
<pre class="brush: csharp;">
if (engine.WasTouchReleased())
{
    //Create a new bot and stick it on the line we just created
    var bot = this.CreateBot(this.currentLine);
    this.engine.WorldEntities.Add(bot);

    this.pickedUp = false;
    this.currentLine = null;
}
</pre>
<p>The final thing in our main game update is to continue creating the line if we're moving around with our mouse.</p>
<pre class="brush: csharp;">
if (this.pickedUp)
{
    this.ContinueCreatingLine();
}
</pre>
<p>To do this we must calculate the distance between the last dot in the line and the new position of our mouse.<br />
If the distance is greater than the size of a dot, we can add a new one to the line.<br />
We also give it a little gap so that it looks prettier.</p>
<pre class="brush: csharp;">
private void ContinueCreatingLine()
{
    // Get the position of the last item in the points
    Vector2 lastPos = this.currentLine.Points[this.currentLine.Points.Count - 1];

    // If the distance is greater than the width of a dot
    if (Vector2.Distance(engine.MousePosition, lastPos) &gt; dot.Width)
    {
        // Get the direction from the last point
        Vector2 dir = engine.MousePosition - lastPos;
        dir.Normalize();

        // Push the new point out at by the width of a dot plus a gap
        int gap = 5;
        var newPosition = lastPos + (dir * (dot.Width + gap));

        // Add it on to the current lines list.
        var newPoint = new Vector2(newPosition.X, newPosition.Y);

        this.currentLine.Points.Add(newPoint);
    }
}
</pre>
<p>And that's it, we can drag our mouse cursor around the screen and draw a dashed line.<br />
As stated a little earlier we want to make this more interesting by adding something which will follow this line. Otherwise it's fairly pointless <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Going back to the line which created a new world entity when the line was completed.</p>
<pre class="brush: csharp;">
var bot = this.CreateBot(this.currentLine);
this.engine.WorldEntities.Add(bot);
</pre>
<p>I've created a custom BotEntity which has custom update logic.</p>
<p>The creation of the BotEntity sets the current line as it's path.</p>
<pre class="brush: csharp;">
private BotEntity CreateBot(CustomLineEntity line)
{
    BotEntity bot = new BotEntity();
    bot.Texture = this.botTexture;
    bot.Size = new Point(bot.Texture.Width, bot.Texture.Height);
    bot.LineToFollow = line;
    bot.Position = line.Position;
    bot.Layer = 1;
    return bot;
}
</pre>
<p>In the main game class we also have a Clear method which clears out the world entities if you press escape.</p>
<p>Here's the complete class.</p>
<pre class="brush: csharp;">
    public class Game1 : Microsoft.Xna.Framework.Game
    {
        private GraphicsDeviceManager graphics;
        private SpriteBatch spriteBatch;
        private Texture2D dot;
        private Texture2D botTexture;
        private MicroEngine engine;

        private bool pickedUp;
        private CustomLineEntity currentLine;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = &quot;Content&quot;;
            this.IsMouseVisible = true;
            this.graphics.PreferredBackBufferWidth = 480;
            this.graphics.PreferredBackBufferHeight = 272;
        }

        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            dot = Content.Load&lt;Texture2D&gt;(&quot;dot&quot;);
            this.botTexture = Content.Load&lt;Texture2D&gt;(&quot;bot&quot;);
            this.engine = new MicroEngine();
        }

        protected override void Update(GameTime gameTime)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Clear();
            }

            this.engine.Update(gameTime);

            if (engine.WasNewTouch())
            {
                // Start the line dragging by adding a CustomLineEntity to the engines WorldEntities
                this.pickedUp = true;

                this.currentLine = new CustomLineEntity();
                this.currentLine.Texture = dot;
                this.currentLine.Position = engine.MousePosition;
                this.currentLine.Points.Add(new Vector2(engine.MousePosition.X, engine.MousePosition.Y));
                this.engine.WorldEntities.Add(this.currentLine);
            }

            if (engine.WasTouchReleased())
            {
                //Create a new bot and stick it on the line we just created
                var bot = this.CreateBot(this.currentLine);
                this.engine.WorldEntities.Add(bot);

                this.pickedUp = false;
                this.currentLine = null;
            }

            if (this.pickedUp)
            {
                this.ContinueCreatingLine();
            }

            base.Update(gameTime);
        }

        private void ContinueCreatingLine()
        {
            // Get the position of the last item in the points
            Vector2 lastPos = this.currentLine.Points[this.currentLine.Points.Count - 1];

            // If the distance is greater than the width of a dot
            if (Vector2.Distance(engine.MousePosition, lastPos) &gt; dot.Width)
            {
                // Get the direction from the last point
                Vector2 dir = engine.MousePosition - lastPos;
                dir.Normalize();

                // Push the new point out at by the width of a dot plus a gap
                int gap = 5;
                var newPosition = lastPos + (dir * (dot.Width + gap));

                // Add it on to the current lines list.
                var newPoint = new Vector2(newPosition.X, newPosition.Y);

                this.currentLine.Points.Add(newPoint);
            }
        }

        private BotEntity CreateBot(CustomLineEntity line)
        {
            BotEntity bot = new BotEntity();
            bot.Texture = this.botTexture;
            bot.Size = new Point(bot.Texture.Width, bot.Texture.Height);
            bot.LineToFollow = line;
            bot.Position = line.Position;
            bot.Layer = 1;
            return bot;
        }

        private void Clear()
        {
            this.engine.WorldEntities.Clear();
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            this.engine.Draw(this.spriteBatch);

            base.Draw(gameTime);
        }
    }
</pre>
<p>The bot is a little more complex and is slightly out of scope of the article. But i'll briefly go over what this entity does.</p>
<p>On creation it was supplied a CustomLineEntity class to use as it's path.<br />
We want the bot to turn as it goes around the curvy line as it moves along it.<br />
For this we use the TurnToFace and WrapAngle methods from the Chase And Evade sample on creators</p>
<p>http://creators.xna.com/en-US/sample/chaseevade</p>
<p>In the main Update of the BotEntity we first check if we have a valid target. If we don't we must be just starting or we've got to the end.<br />
Use the first point in the list as our reference point.</p>
<pre class="brush: csharp;">
public override void Update(float elapsed)
{
    if (!this.destinationReached &amp;&amp; this.LineToFollow != null)
    {
        if (!this.target.HasValue)
        {
            if (this.LineToFollow.Points.Count &gt; 0)
            {
                this.target = this.LineToFollow.Points[0].Position;
                this.targetIndex = 0;
            }
        }
</pre>
<p>If the bot does have a valid target, we should move towards it and turn smoothly.<br />
If the distance is short enough to be considered reached, we move onto the next target.<br />
If there's no next target available, we're at our destination.</p>
<pre class="brush: csharp;">
this.MoveToTarget(elapsed);
if (Vector2.Distance(this.Position, this.target.Value) &lt; distThreshold)
{
    if (targetIndex + 1 &lt; this.LineToFollow.Points.Count)
    {
        this.targetIndex++;
        this.target = this.LineToFollow.Points[this.targetIndex].Position;
    }
    else
    {
        this.destinationReached = true;
    }
}
</pre>
<p>I'm not going to print out the TurnToFace method here, but this is how we use it to turn and move towards our target.<br />
We get the direction between our current position and our target.<br />
We then use the simple calculation of direction * speed * time to move it smoothly towards the target.<br />
And finally we set the rotation using the TurnToFace method.</p>
<pre class="brush: csharp;">
private void MoveToTarget(float elapsed)
{
    var direction = this.target.Value - this.Position;
    if (direction == Vector2.Zero)
    {
        return;
    }

    direction.Normalize();

    const float speed = 50;
    const float turnSpeed = 0.025f;
    this.Position += direction * speed * elapsed;
    this.Rotation = TurnToFace(this.Position, this.target.Value, this.Rotation, turnSpeed);
}
</pre>
<p>If we now run our sample we can drag a curvy dotted line onto the screen with our mouse and a world object will follow it nicely <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  cool uh?</p>
<p>Now we need to make this work on the Zune.<br />
First we must create a new project type for Zune. this is easy using the built in visual studio create copy feature.</p>
<p>Luckily for us, the Micro Engine already supports Zune and has the code to treat a touch just like a mouse touch.</p>
<p>It has a few #if(ZUNE) batches of code inside WasTouchReleased and WasNewTouch</p>
<p>They look like this</p>
<pre class="brush: csharp;">
public bool WasNewTouch()
{
    if (this.LastMouseState.LeftButton == ButtonState.Released &amp;&amp;
        this.CurrentMouseState.LeftButton == ButtonState.Pressed)
    {
        return true;
    }
#if(ZUNE)
    if (this.currentTouchState != null)
    {
        if (currentTouchState.State == TouchLocationState.Pressed)
        {
            if (lastTouchState != null)
            {
                if (lastTouchState.State == TouchLocationState.Released)
                {
                    return true;
                }
            }
            else
            {
                return true;
            }
        }
    }
#endif

    return false;
}

public bool WasTouchReleased()
{
    if (this.LastMouseState.LeftButton == ButtonState.Pressed &amp;&amp;
        this.CurrentMouseState.LeftButton == ButtonState.Released)
    {
        return true;
    }
#if(ZUNE)
    if (this.currentTouchState != null)
    {
        if (currentTouchState.State == TouchLocationState.Released)
        {
            return true;
        }
    }
#endif

    return false;
}
</pre>
<p>This now runs on the Zune HD <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I'm sure there are lots of improvements that can be made here. But it's good enough for my prototype <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
The main one I would like to improve on in future would be the smoothness of the curve much like the Flight Control example at the beginning.</p>
<p>Here's the full source code<br />
<a href="http://www.sgtconker.com/Downloads/articles/DrawMeALine.zip">Download Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/article-draw-me-a-line-zune-hd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Would you like George&#8217;s input?</title>
		<link>http://www.sgtconker.com/2010/03/would-you-like-georges-input/</link>
		<comments>http://www.sgtconker.com/2010/03/would-you-like-georges-input/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 08:04:09 +0000</pubDate>
		<dc:creator>Captain ZSquare</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[George Clingerman]]></category>
		<category><![CDATA[Input]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1234</guid>
		<description><![CDATA[Well, not George's input, but yours! George's new sample demonstrates a wrapper around input that you can easily use in your games.
And while you're there, you can give him some feedback, because he always appreciates it, and would like to know what he can do to help everyone. Because he's the "good" MVP, apparently  [...]]]></description>
			<content:encoded><![CDATA[<p>Well, not George's input, but yours!<a href="http://geekswithblogs.net/clingermangw/archive/2010/03/06/138372.aspx"> George's new sample </a>demonstrates a wrapper around input that you can easily use in your games.</p>
<p>And while you're there, you can give him some feedback, because he always appreciates it, and would like to know what he can do to help everyone. Because he's the "good" MVP, apparently <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And btw, for those that came back from Mars recently, George is THE MAN behind <a href="http://www.xnadevelopment.com/tutorials.shtml">XNADevelopment.com</a>, a great site for beginner tutorials that are well written and easy to follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/would-you-like-georges-input/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Report on Nick</title>
		<link>http://www.sgtconker.com/2010/03/report-on-nick/</link>
		<comments>http://www.sgtconker.com/2010/03/report-on-nick/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 07:57:07 +0000</pubDate>
		<dc:creator>Captain ZSquare</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Arrays]]></category>
		<category><![CDATA[Nick Gravelyn]]></category>
		<category><![CDATA[Resize]]></category>
		<category><![CDATA[Too much time]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1232</guid>
		<description><![CDATA[Nick Gravelyn still seems to have too much time on his hand, because he keeps churning out stuff on his blog:
First he talks about resizing 2D arrays;
Then he comes back and craetes more extension methods for arrays;
Then he gives up on creating his own editor, and teaches us how to be lazy, like him.
]]></description>
			<content:encoded><![CDATA[<p>Nick Gravelyn still seems to have too much time on his hand, because he keeps churning out stuff on his blog:</p>
<p>First he talks about <a href="http://nickgravelyn.com/2010/03/resizing-2d-arrays/">resizing 2D arrays</a>;</p>
<p>Then he comes back and craetes <a href="http://nickgravelyn.com/2010/03/further-extending-c-arrays/">more extension methods for arrays</a>;</p>
<p>Then he gives up on creating his own editor, and teaches us<a href="http://nickgravelyn.com/2010/03/know-when-to-be-lazy/"> how to be lazy, like him</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/report-on-nick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Tools: PerfHUD</title>
		<link>http://www.sgtconker.com/2010/03/performance-tools-perfhud/</link>
		<comments>http://www.sgtconker.com/2010/03/performance-tools-perfhud/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 07:51:44 +0000</pubDate>
		<dc:creator>Captain ZSquare</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Matt Pettineo]]></category>
		<category><![CDATA[PerfHUD]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1230</guid>
		<description><![CDATA[Matt "Perf Analyzer" Pettineo has a new post about analyzing Direct3D performance using NVIDIA PerfHUD, where he goes into great deal about each feature of the tool. Read all about it on his blog.

]]></description>
			<content:encoded><![CDATA[<p>Matt "Perf Analyzer" Pettineo has a new post about analyzing Direct3D performance using NVIDIA PerfHUD, where he goes into great deal about each feature of the tool. <a href="http://mynameismjp.wordpress.com/2010/03/06/d3d-performance-and-debugging-tools-round-up-perfhud/">Read all about it on his blog</a>.</p>
<p style="text-align: center;"><a href="http://mynameismjp.wordpress.com/2010/03/06/d3d-performance-and-debugging-tools-round-up-perfhud/"><img class="aligncenter" title="PerfHUD" src="http://mynameismjp.files.wordpress.com/2010/02/unitusage.png" alt="" width="434" height="171" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/performance-tools-perfhud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Return of Light Pre Pass</title>
		<link>http://www.sgtconker.com/2010/03/return-of-light-pre-pass/</link>
		<comments>http://www.sgtconker.com/2010/03/return-of-light-pre-pass/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 07:44:28 +0000</pubDate>
		<dc:creator>Captain ZSquare</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Floris Groen]]></category>
		<category><![CDATA[light pre pass]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/?p=1227</guid>
		<description><![CDATA[Word just reached us that there's a new demo of how to use the light prepass technique in XNA. You can find it here.
How does it compare to the other article on light pre pass? Tell us in the comments  
]]></description>
			<content:encoded><![CDATA[<p>Word just reached us that there's a new demo of how to use the light prepass technique in XNA. You can find it <a href="http://lightprepassrenderer.codeplex.com/">here</a>.</p>
<p>How does it compare to the <a href="http://www.sgtconker.com/2009/12/light-pre-pass-in-xna/">other </a>article on light pre pass? Tell us in the comments <img src='http://www.sgtconker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/return-of-light-pre-pass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 Day Challenge Number 6</title>
		<link>http://www.sgtconker.com/2010/03/7-day-challenge-number-6/</link>
		<comments>http://www.sgtconker.com/2010/03/7-day-challenge-number-6/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 12:32:57 +0000</pubDate>
		<dc:creator>Captain boki</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[XNA7Day]]></category>

		<guid isPermaLink="false">http://www.sgtconker.com/2010/03/7-day-challenge-number-6/</guid>
		<description><![CDATA[David Amador announced the next XNA 7 Day Challenge. Check the his post for the full details.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.david-amador.com/">David Amador</a> announced the next XNA 7 Day Challenge. Check the <a href="http://xna7day.com/challenge-6-%e2%80%93-pipes/">his post for the full details</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sgtconker.com/2010/03/7-day-challenge-number-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
