<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Silverlight Game – Part 4 - Adding drag and drop functionality to move the cars around</title><link>http://blogs.msdn.com/b/tess/archive/2009/03/04/silverlight-game-part-4-adding-drag-and-drop-functionality-to-move-the-cars-around.aspx</link><description>This is part four in a series of 5 posts showing how I built a simple game in Silverlight, you can follow along (reading the posts in order) to build your own Traffic Jam game. 
 I would recommend that you also go through ScottGu’s silverlight tutorials</description><dc:language>sv-SE</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Interesting Finds: 2009 03.04~03.09</title><link>http://blogs.msdn.com/b/tess/archive/2009/03/04/silverlight-game-part-4-adding-drag-and-drop-functionality-to-move-the-cars-around.aspx#9467086</link><pubDate>Mon, 09 Mar 2009 05:28:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9467086</guid><dc:creator>Community Blogs</dc:creator><description>&lt;p&gt;.NET ASP.NET Routing performance compare to HttpHandler LINQ on Objects Performance Why My ASP.NET Application&amp;amp;#39;s&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9467086" width="1" height="1"&gt;</description></item><item><title>re: Silverlight Game – Part 4 - Adding drag and drop functionality to move the cars around</title><link>http://blogs.msdn.com/b/tess/archive/2009/03/04/silverlight-game-part-4-adding-drag-and-drop-functionality-to-move-the-cars-around.aspx#9458769</link><pubDate>Wed, 04 Mar 2009 21:28:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9458769</guid><dc:creator>Craig</dc:creator><description>&lt;p&gt;And similar code for top in the Vertical case is a little vague: here is the code:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;double top = Canvas.GetTop(currentCar) + currentPoint.Y - lastPoint.Y;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;double minY = GetMinY(currentCar.Row, currentCar.Column);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;double maxY = GetMaxY(currentCar.Row, currentCar.Column, currentCar.Length);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (top &amp;lt;= minY) top = minY;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (top &amp;gt;= maxY) top = maxY;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Canvas.SetTop(currentCar, top);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lastPoint = currentPoint;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9458769" width="1" height="1"&gt;</description></item><item><title>Silverlight Game – Part 4 - Adding drag and drop functionality to move the cars around</title><link>http://blogs.msdn.com/b/tess/archive/2009/03/04/silverlight-game-part-4-adding-drag-and-drop-functionality-to-move-the-cars-around.aspx#9458555</link><pubDate>Wed, 04 Mar 2009 17:59:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9458555</guid><dc:creator>What's New</dc:creator><description>&lt;p&gt;This is part four in a series of 5 posts showing how I built a simple game in Silverlight, you can follow&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9458555" width="1" height="1"&gt;</description></item><item><title>If broken it is, fix it you should : Silverlight Game ??? Part 3 - Using Linq to XML to read and generate the levels</title><link>http://blogs.msdn.com/b/tess/archive/2009/03/04/silverlight-game-part-4-adding-drag-and-drop-functionality-to-move-the-cars-around.aspx#9458284</link><pubDate>Wed, 04 Mar 2009 12:46:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9458284</guid><dc:creator>If broken it is, fix it you should : Silverlight Game ??? Part 3 - Using Linq to XML to read and generate the levels</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/tess/archive/2009/03/04/silverlight-game-part-3-using-linq-to-xml-to-read-and-generate-the-levels.aspx"&gt;http://blogs.msdn.com/tess/archive/2009/03/04/silverlight-game-part-3-using-linq-to-xml-to-read-and-generate-the-levels.aspx&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9458284" width="1" height="1"&gt;</description></item></channel></rss>