<?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>Silverlight Buzz &#187; Silverllight Games</title>
	<atom:link href="http://www.silverlightbuzz.com/category/silverllight-games/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.silverlightbuzz.com</link>
	<description>Gavin Wignall Blogs about Silverlight tutorials and examples</description>
	<lastBuildDate>Mon, 12 Dec 2011 17:05:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Festive game using Silverlight and Farseer Physics Engine</title>
		<link>http://www.silverlightbuzz.com/2011/12/12/festive-game-using-silverlight-and-farseer-physics-engine/</link>
		<comments>http://www.silverlightbuzz.com/2011/12/12/festive-game-using-silverlight-and-farseer-physics-engine/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 17:05:41 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Farseer Physics Engine]]></category>
		<category><![CDATA[Silverlight News]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Codeplex]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Gravity]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Silverlight 4]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=959</guid>
		<description><![CDATA[As the Winter months came upon us I once again, at Metia, had the opportunity to create a Festive game...]]></description>
			<content:encoded><![CDATA[<p>As the Winter months came upon us I once again, at <a title="Metia" href="http://www.metia.com">Metia</a>, had the opportunity to create a Festive game for the UK Microsoft Partner team. Through the success of last years game we were given more time and budget to make sure this years game stepped up a level. <a title="Festive Game" href="http://festivegame.cloudapp.net/">Go play the game!</a></p>
<p>This was the perfect chance for me to use the <a title="Farseer Physics website" href="http://farseerphysics.codeplex.com/">Farseer Physics Engine</a>. Farseer Physics Engine is a collision detection system with realistic physics responses, it is free to use and runs on the <a title="Microsoft Silverlight" href="http://www.silverlight.net/">Silverlight platform</a>.</p>
<p>Being a festive game, I went for a Santa theme. The general gist is to move the sleigh, collect the presents and then drop them into the passing houses. Your score is then based on the presents collected, the presents you delivered and the the time you complete the course in.</p>
<p>The game boasts 18 levels, with achievements and special unlock levels. There is a global scoreboard that keeps track of your total score and ranks you accordingly.</p>
<p>Microsoft Partners were given the chance to customise the game. A customised version allows the Partner to add in their company name and logo to the home screen along with their logo featuring at the start and end of each level.</p>
<h3>Welcome screen</h3>
<p><a href="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameHome.jpg"><img class="alignnone size-full wp-image-961" title="FestiveGameHome" src="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameHome.jpg" alt="" width="580" height="348" /></a></p>
<h3>Level selection &amp; stats</h3>
<p><a href="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevels.jpg"><img class="alignnone size-full wp-image-966" title="FestiveGameLevels" src="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevels.jpg" alt="" width="580" height="347" /></a></p>
<h3>Flying over houses</h3>
<p><a href="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel3.jpg"><img class="alignnone size-full wp-image-962" title="FestiveGameLevel3" src="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel3.jpg" alt="" width="580" height="348" /></a></p>
<h3>Crashing into houses</h3>
<p><a href="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel10.jpg"><img class="alignnone size-full wp-image-963" title="FestiveGameLevel10" src="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel10.jpg" alt="" width="580" height="346" /></a></p>
<p><span class="Apple-style-span" style="font-size: 15px; font-weight: bold;">Navigate over jumps, around loops and over gaps </span></p>
<p><a href="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel15.jpg"><img class="alignnone size-full wp-image-964" title="FestiveGameLevel15" src="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel15.jpg" alt="" width="580" height="348" /></a></p>
<p><span class="Apple-style-span" style="font-size: 15px; font-weight: bold;">Deliver presents without crashing</span></p>
<p><a href="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel18.jpg"><img class="alignnone size-full wp-image-965" title="FestiveGameLevel18" src="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameLevel18.jpg" alt="" width="580" height="348" /></a></p>
<p><span class="Apple-style-span" style="font-size: 15px; font-weight: bold;">Global scoreboard will give you your rank</span></p>
<p><a href="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameScoreboard.jpg"><img class="alignnone size-full wp-image-967" title="FestiveGameScoreboard" src="http://www.silverlightbuzz.com/wp-content/uploads/2011/12/FestiveGameScoreboard.jpg" alt="" width="580" height="349" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2011/12/12/festive-game-using-silverlight-and-farseer-physics-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone &#8211; running game loops in Silverlight</title>
		<link>http://www.silverlightbuzz.com/2011/02/07/windows-phone-running-game-loops-in-silverlight/</link>
		<comments>http://www.silverlightbuzz.com/2011/02/07/windows-phone-running-game-loops-in-silverlight/#comments</comments>
		<pubDate>Mon, 07 Feb 2011 09:58:13 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[Silverlight C# Tutorials]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Working with Silverlight]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CompositionTarget.Rendering]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[DispatchTimer]]></category>
		<category><![CDATA[Game loop]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[looping]]></category>
		<category><![CDATA[Silverlight 4]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=951</guid>
		<description><![CDATA[While developing my WP7 game Bitbreaker, I tried and tested several methods to get a reliable game loop running. What...]]></description>
			<content:encoded><![CDATA[<p>While developing my WP7 game <a title="Bitbreaker on the Windows Phone" href="http://www.silverlightbuzz.com/2011/01/27/bitbreaker-for-the-windows-phone-7/" target="_self">Bitbreaker</a>, I tried and tested several methods to get a reliable game loop running.</p>
<h2>What is a game loop</h2>
<p>Many games require movement that is affected by constant changing factors. This often requires that movement to be adjusted on a regular basis. In arcade games, for example <a title="Read the Bitbreaker post" href="http://www.silverlightbuzz.com/2011/01/27/bitbreaker-for-the-windows-phone-7/" target="_self">Bitbreaker</a>, this action is required to happen many times each second. A game loop is the function that fires this repeatable action on a regular basis.</p>
<h2>Game loop types</h2>
<p>I tried the following types of game loops while developing my Windows Phone App.</p>
<ul>
<li>Looping a storyboard</li>
<li>Composition Target Rendering</li>
<li>Dispatch Timer</li>
</ul>
<h2>Looping a storyboard</h2>
<p>This is a very simple way to create a game loop.</p>
<ol>
<li>Create a storyboard either in the XAML or in your code behind file.</li>
<li>Set the storyboards duration to the amount of time you want delayed between each action.</li>
<li>Set the storyboard to repeat forever.</li>
<li>Set up a Storyboard.Completed Event handler to fire a function every time your storyboard plays out: <span style="color: #3366ff;">Storyboard.Completed += new EventHandler(Storyboard_Completed);</span></li>
<li>Place your game logic inside the function called on completed.</li>
</ol>
<h2>CompositionTarget.Rendering</h2>
<p>This is a good way to ensure your game loop is called every possible chance it can as it matches your games frame rate.</p>
<ol>
<li>Add CompositionTarget.Rendering to your event handlers: <span style="color: #3366ff;">CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);</span></li>
<li>Place your game logic inside the function called</li>
</ol>
<h2>Dispatch Timer</h2>
<p>This is good way to control your game loop repeating at a consistent rate.</p>
<ol>
<li>Add the new reference: <span style="color: #3366ff;">using System.Windows.Threading;</span></li>
<li>Declare Dispatch Timer as a member: <span style="color: #3366ff;">DispatcherTimer timer = new DispatcherTimer();</span></li>
<li><span style="color: #3366ff;"><span style="color: #000000;">Set the interval value to control the time delay between each action:</span> timer.Interval = TimeSpan.FromMilliseconds(25);</span></li>
<li><span style="color: #3366ff;"><span style="color: #000000;">Set up a Tick event handler on our DispatchTimer:</span> timer.Tick += new EventHandler(timer_Tick);</span></li>
<li><span style="color: #000000;">Place your game logic inside the function called on each Tick.</span></li>
<li><span style="color: #3366ff;"><span style="color: #000000;">Start the DispatchTimer:</span> timer.Start();</span></li>
</ol>
<h2>The results</h2>
<p>After trying all 3 methods on a Windows Phone, I found the <strong>DispatchTimer </strong>to be the best suited for <a title="Windows Phone game example" href="http://www.silverlightbuzz.com/2011/01/27/bitbreaker-for-the-windows-phone-7/" target="_self">my Windows Phone game</a>. So while many people think Windows Phones are more suited for business users and the odd chore like <a href="http://www.policyexpert.co.uk/home-insurance/buildings-insurance/">comparing buildings insurance</a> online, these results show that it&#8217;s more than suitable for gaming. I needed to get the fastest frame rate but also keep the movement in my game consistent. The dispatch timer achieved this very well.</p>
<p>I found using the <strong>looping storyboard </strong>approach gave me a low frame rate as it required communicating with the XAML each time, even if there were no visible parts moving.</p>
<p>I use the <strong>CompositionTarget.Rendering</strong> route often when creating games for the common desktop PC, this is due to it giving a very fast loop. However, when developing for the Windows Phone, we are using a much slower processor and can&#8217;t guarantee the frame rate will stay consistent. For Bitbreaker I required the ball to keep a consistent speed, using this approach would make the ball speed up and slow down when asking the game to perform different tasks of varying difficulty.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2011/02/07/windows-phone-running-game-loops-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bitbreaker for the Windows Phone 7</title>
		<link>http://www.silverlightbuzz.com/2011/01/27/bitbreaker-for-the-windows-phone-7/</link>
		<comments>http://www.silverlightbuzz.com/2011/01/27/bitbreaker-for-the-windows-phone-7/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 22:22:46 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight News]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Working with Silverlight]]></category>
		<category><![CDATA[Bitbreaker]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Drag]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Marketplace]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Silverlight 4]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=939</guid>
		<description><![CDATA[My first Windows Phone 7 App has just gone live on the Marketplace. It costs only 79p / $0.99 in...]]></description>
			<content:encoded><![CDATA[<p>My first Windows Phone 7 App has just gone live on the Marketplace. It costs only 79p / $0.99 in the UK/US so please go buy it and give me some nice feedback <img src='http://www.silverlightbuzz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p><a href="http://social.zune.net/redirect?type=phoneApp&amp;id=c1b90726-101b-e011-9264-00237de2db9e"><img title="bitbreaker for the Windows Phone 7 on Zune" src="http://www.silverlightbuzz.com/images/bitbreaker-montage.jpg" alt="" width="817" height="336" /></a></p>
<p><a title="Bitbreaker on Marketplace" href="http://social.zune.net/redirect?type=phoneApp&amp;id=c1b90726-101b-e011-9264-00237de2db9e" target="_self">Click here to view Bitbreaker on the Marketplace (you will need Zune installed).</a></p>
<p>As this was my first attempt at producing a Mobile app, I knew I was in for some interesting learning curves. Because of this I decided that my first app should be based on the well established bat and ball style game.</p>
<h2>Game features</h2>
<p>The launch version consists of the following features:</p>
<ul>
<li>1 free trial level</li>
<li>36 additional levels in the full game</li>
<li>5 power-up blocks that effect game play</li>
<li>6 types of blocks to hit varying in strength</li>
<li>1 bat that deflects the ball lower at the edges</li>
<li>An exponential multiplier point system requiring skill to master</li>
<li>3 tier achievement system for each level</li>
<li>Fast level restart system for people trying to hit those top achievements</li>
</ul>
<h2>Level designs</h2>
<p>The level designs range from quirky retro designs honoring the game industries history to complex and tough mazes. The user is required to complete a level before unlocking the next one to play.</p>
<h2>Multiplier bonus system</h2>
<p>I wanted to encourage players to try and trap the ball in mazes instead of just bashing away brick by brick. To help this I implemented a multiplier point system. Each time the player destroys a block they get an additional multiplier point that multiplies the score you get for destroying the next block. When the ball hits the bat then the multiplier bonus resets back to zero. This means in order to score high points the player needs to trap the ball so that it destroys several blocks before hitting the bat again. Some later complex levels allow the user to score massive points if played correctly</p>
<h2>Obstacles overcome</h2>
<p>During my progress I had several obstacles present themselves that I had to work around.</p>
<p>The first one, that presented itself early on, was having to code for a mobile processor. Having created Silverlight experiences for desktop PCs over the last 4 years has somewhat spoiled me over the years, meaning I have not had to be too careful about how many times I check values within the XAML. I found with the Windows Phone platform that taking my usual approach to creating a game left me with an unimpressive framerate when testing on the device. I soon learnt my lesson and started storing data in arrays and variables, this meant my app only had to trawl the XAML tree when it absolutely needed to.</p>
<p>The second obstacle was getting my app to load quickly on the test device. I found that my initial approach, running a for loop to create 81 block controls, took nearly 40 seconds to load. Two of the rules set out by Microsoft in order to have your app approved are:</p>
<p>Your app must load within 20 seconds</p>
<p>Upon restarting your app from a tombstone state it must take under 5 seconds to load</p>
<p>I found that asking the app to create and then draw so many controls upfront was a big task. To get around this I placed the controls into the XAML and set their visibility to collapsed so that the app did not have to redraw them until I asked it to later on.</p>
<p>The last problem was associated with the type of game I was creating. As I wanted to include blocks that were solid (could not be destroyed) I had the possibility that the ball could get stuck in an indefinite loop. To get around this I implemented a piece of code that checks to see if the ball has been trapped for a prolonged set of time and then adjust the balls trajectory slightly. This process is then repeated until the ball registers a hit with the bat.</p>
<h2>Future updates</h2>
<p>I have several plans for updates to Bitbreaker. They include some of the following:</p>
<ul>
<li>Plenty of more stages and levels</li>
<li>Invisible blocks</li>
<li>Moving blocks</li>
<li>New bat types to unlock each holding different characteristics</li>
<li>New Ball types to unlock each holding different characteristics</li>
<li>Multi-ball</li>
<li>A time trial mode that selects random levels</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2011/01/27/bitbreaker-for-the-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Launch of Festive game built with Silverlight 4, hosted on Azure</title>
		<link>http://www.silverlightbuzz.com/2010/12/08/launch-of-festive-game-built-with-silverlight-4-hosted-on-azure/</link>
		<comments>http://www.silverlightbuzz.com/2010/12/08/launch-of-festive-game-built-with-silverlight-4-hosted-on-azure/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 15:58:37 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight News]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Designers]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Direction]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Gravity]]></category>
		<category><![CDATA[Silverlight 4]]></category>
		<category><![CDATA[User Input]]></category>
		<category><![CDATA[Windows Phone 7]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=918</guid>
		<description><![CDATA[I have just finished building a Festive game to promote Windows Azure using Silverlight 4! The game is free and...]]></description>
			<content:encoded><![CDATA[<p><img title="festive_banner" src="http://www.silverlightbuzz.com/wp-content/uploads/2010/12/festive_banner.jpg" alt="" width="560" height="150" /></p>
<p>I have just finished building a Festive game to promote Windows Azure using Silverlight 4! The game is free and easy to play, go enjoy it at: <a href="http://festivegame.cloudapp.net/">http://festivegame.cloudapp.net/</a> or read on to hear what it&#8217;s all about&#8230;</p>
<p>Last year I created a Festive game for the Microsoft UK Partner team, with the creative help from our <a title="Metia.com" href="http://www.metia.com" target="_blank">Metia</a> team at Reading TVP, we managed to turn the game around in just one week! You can still play that game here: <a href="http://www.microsoft.com/uk/partner/game/">http://www.microsoft.com/uk/partner/game/</a></p>
<p>After the success of last year we were given the challenge again to create a simple fun Festive game with the focus to be on Windows Azure. Again, I was given the creative support from our <a title="Metia.com" href="http://www.metia.com" target="_blank">Metia</a> TVP team so that I could focus my time on building the game mechanics. Thankfully, this year our turnaround time had been lengthened to two weeks.</p>
<p>Here are some key features and facts about this years game&#8230;</p>
<h3>Really easy to pick up and play</h3>
<p>All you need to do to play the game is use the left and right keys to move the bouncing Santa, absolutely no rocket science required! Increase your score by jumping up the clouds, make sure you don&#8217;t miss or it could be game over! Watch out for Santa&#8217;s run-a-way sleigh, it may drop bonus presents that you can catch for bonus speed. The presents randomly drop in different directions each time and there is no guarantee a present will drop, so choose carefully when to leap for joy. Collect six presents for a super speed bonus that will really send you up into new heights.</p>
<h3>Challenge a Friend</h3>
<p>Once you have had a go and achieved a score, you can challenge a friend! Simply fill in the email of a friend and send. When your friend follows the link you sent they will see your score in the top left of the screen and how far left they need to jump to beat it. We are hoping this will entice people to share the game and make it &#8220;go viral&#8221;.</p>
<h3>Global Scoreboard</h3>
<p>With thanks going to some of our team here at Metia London, we created a global scoreboard so you can try to be the best out there! The scoreboard allows you to put in a nickname and your organisation to help with bragging rights &#8211; again, we hope this helps people want to share the game.</p>
<h3>Your High Score</h3>
<p>I used the Isolated storage feature of Silverlight 4 to save your own high score to your PC. This allows you to see your personal best score even if you have left the website and come back another day.</p>
<h3>Built for Windows Phone 7</h3>
<p>We took the opportunity right from the outset to build this game so that it would easily be converted for Windows Phone 7. The resolution is already at 480 x 800, the controls are really simple and could either be implemented through on-screen buttons or using the accelerometer. We hope either a similar version or re-skinned version will be coming to the Windows Phone 7 soon!</p>
<p>Here are a selection of screen shots from the game.</p>
<div id="attachment_924" class="wp-caption alignnone" style="width: 500px"><a href="http://festivegame.cloudapp.net/"><img class="size-full wp-image-924 " title="festive_game_start" src="http://www.silverlightbuzz.com/wp-content/uploads/2010/12/festive_game_start.jpg" alt="Santa starting from the mountain side" width="490" height="809" /></a><p class="wp-caption-text">Santa starting from the mountain side</p></div>
<div id="attachment_920" class="wp-caption alignnone" style="width: 500px"><a href="http://festivegame.cloudapp.net/"><img class="size-full wp-image-920 " title="festive_game_challenge" src="http://www.silverlightbuzz.com/wp-content/uploads/2010/12/festive_game_challenge.jpg" alt="Challenge a friend" width="490" height="809" /></a><p class="wp-caption-text">Note challenge a friend score in top left</p></div>
<div id="attachment_921" class="wp-caption alignnone" style="width: 500px"><a href="http://festivegame.cloudapp.net/"><img class="size-full wp-image-921 " title="festive_game_rocket" src="http://www.silverlightbuzz.com/wp-content/uploads/2010/12/festive_game_rocket.jpg" alt="" width="490" height="809" /></a><p class="wp-caption-text">Collect falling presents to gain a speed bonus</p></div>
<div id="attachment_919" class="wp-caption alignnone" style="width: 500px"><a href="http://festivegame.cloudapp.net/"><img class="size-full wp-image-919 " title="festive_game_balloon" src="http://www.silverlightbuzz.com/wp-content/uploads/2010/12/festive_game_balloon.jpg" alt="" width="490" height="809" /></a><p class="wp-caption-text">Keep climbing higher and higher and pass other flying objects</p></div>
<div id="attachment_923" class="wp-caption alignnone" style="width: 500px"><a href="http://festivegame.cloudapp.net/"><img class="size-full wp-image-923 " title="festive_game_space" src="http://www.silverlightbuzz.com/wp-content/uploads/2010/12/festive_game_space.jpg" alt="" width="490" height="809" /></a><p class="wp-caption-text">Watch out for Santa&#39;s run-a-way sleigh in case any presents fall from it</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2010/12/08/launch-of-festive-game-built-with-silverlight-4-hosted-on-azure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Launch of the MSUK Partner Festive Game</title>
		<link>http://www.silverlightbuzz.com/2009/12/18/launch-of-the-msuk-partner-festive-game/</link>
		<comments>http://www.silverlightbuzz.com/2009/12/18/launch-of-the-msuk-partner-festive-game/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 12:31:36 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight News]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Designers]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Direction]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Mouse position]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Rotation]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[User Input]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=721</guid>
		<description><![CDATA[I have had great fun developing a new Silverlight game (here at Metia) for the Microsoft UK Partner Network Team which...]]></description>
			<content:encoded><![CDATA[<p>I have had great fun developing a new Silverlight game (here at <a href="http://www.metia.com" target="_blank">Metia</a>) for the <a href="http://www.microsoft.com/uk/partner/game/" target="_blank">Microsoft UK Partner Network Team</a> which has now officially gone live! Please visit the game <a href="http://www.microsoft.com/uk/partner/game/" target="_blank">here</a> to have a go and see if you can beat my personal top score of <strong>443</strong>! Be sure to let me know what your top scores are under the comments section <img src='http://www.silverlightbuzz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.microsoft.com/uk/partner/game/"><img class="alignnone" title="Click to play the MSUK Partner Silverlight game" src="http://www.silverlightbuzz.com/images/MSUKPartnerGame.JPG" alt="" width="490" height="419" /></a></p>
<p>The game is built using <a href="http://www.silverlight.net" target="_blank">Silverlight 3</a> and features the following:</p>
<ul>
<li>Silverlight plug-in detection</li>
<li>Custom pre-loader animation</li>
<li>Options for mouse or keyboard controls in game</li>
<li>Saves your top score using Isolated Storage</li>
<li>Different AI and traits for each of the 4 bad guys</li>
<li>Bonus points for collecting prizes faster</li>
<li>Lots of cool effects like trailing footsteps and 3D score indicators</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2009/12/18/launch-of-the-msuk-partner-festive-game/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight driving game with Farseer Physics</title>
		<link>http://www.silverlightbuzz.com/2009/08/21/silverlight-driving-game-with-farseer-physics/</link>
		<comments>http://www.silverlightbuzz.com/2009/08/21/silverlight-driving-game-with-farseer-physics/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 09:27:09 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight 3 tutorials]]></category>
		<category><![CDATA[Silverlight Blend Tutorials]]></category>
		<category><![CDATA[Silverlight Effects]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Codeplex]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Designers]]></category>
		<category><![CDATA[Direction]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[Farseer Physics Engine]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Gravity]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[User Input]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=449</guid>
		<description><![CDATA[Click the Silverlight area first to give it focus then use the &#8216;A&#8216; and &#8216;S&#8216; keys to drive the truck...]]></description>
			<content:encoded><![CDATA[<p>Click the Silverlight area first to give it focus then use the &#8216;<strong>A</strong>&#8216; and &#8216;<strong>S</strong>&#8216; keys to drive the truck backwards and forwards <img src='http://www.silverlightbuzz.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>In this example I build a very simple driving game using the <a href="http://farseerphysics.codeplex.com/">Farseer Physics engine</a>. This add-on for Silverlight allowed me to build this example purely in Blend without having to touch a single line of code!<br />
<div class="iframe-wrapper">
  <iframe src="http://www.silverlightbuzz.com/silverlightProjects/SilverlightPhysics2/Silverlight_Physics2.html" frameborder="0" style="height:490px;width:490px;">Please upgrade your browser</iframe>
</div>
<p>This example uses the drag and drop joint behaviours available to connect the wheels to the car and allow them to act independantly. I haven&#8217;t spent much time tweaking the available variables so the car is a bit too bouncy &#8211; so if you&#8217;re not careful, expect to roll it!</p>
<p>This example uses the <a href="http://farseerphysics.codeplex.com/">Farseer Physics engine</a> for Silverlight available for download on <a href="http://www.codeplex.com/">Codeplex</a> <a href="http://farseerphysics.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29321#ReleaseFiles">here</a>.</p>
<p>You can see my first example using Farseer Physics <a href="http://www.silverlightbuzz.com/2009/08/19/additional-physics-based-behaviors-for-blend-and-silverlight/">here</a>, this earlier example also links to some tutorial videos that will help you get started.</p>
<h2>Grab the code</h2>
<p>Feel free to download the source for this example <a href="http://www.silverlightbuzz.com/examples/SilverlightPhysics2.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2009/08/21/silverlight-driving-game-with-farseer-physics/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Additional physics based behaviors for Blend and Silverlight</title>
		<link>http://www.silverlightbuzz.com/2009/08/19/additional-physics-based-behaviors-for-blend-and-silverlight/</link>
		<comments>http://www.silverlightbuzz.com/2009/08/19/additional-physics-based-behaviors-for-blend-and-silverlight/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 23:58:16 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight 3 tutorials]]></category>
		<category><![CDATA[Silverlight Blend Tutorials]]></category>
		<category><![CDATA[Silverlight Effects]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Codeplex]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Designers]]></category>
		<category><![CDATA[Direction]]></category>
		<category><![CDATA[Drag]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[Farseer Physics Engine]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[User Input]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=444</guid>
		<description><![CDATA[Click and drag on any of the objects in this example to start the chaos, collisions and fun! This example...]]></description>
			<content:encoded><![CDATA[<p>Click and drag on any of the objects in this example to start the chaos, collisions and fun!</p>
<p>This example uses no C# work, all the work was done inside Blend using behaviours added from the <a href="http://farseerphysics.codeplex.com/">Farseer Physics Engine</a>.</p>
<div class="iframe-wrapper">
  <iframe src="http://www.silverlightbuzz.com/silverlightProjects/SilverlightPhysics/Silverlight_Physics.html" frameborder="0" style="height:490px;width:490px;">Please upgrade your browser</iframe>
</div>
<p>All you need to do is download the Farseer files found <a href="http://farseerphysics.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29321#ReleaseFiles">here</a>, follow their instructions to add the required dlls into your project and Blend will feature a list of new plug and play behaviours to start creating fun games or just some cool crazy stuff like above.</p>
<p>This example took minutes to throw together, in fact I spent more time watching the cool crazy mayhem that it created than building it!</p>
<p>I have not had enough time to fully thrash out this add-ons potential, but first impressions lead to some very &#8216;easy to use&#8217; cool features that will greatly expand your &#8216;bag of tricks&#8217; in the Silverlight world.</p>
<p>There are some very basic, but easy to follow videos to help get you to grips with this add-on found <a href="http://msbluelight-0.agappdom.net/e1/d/20709/586316/63386409600/0.cPqT6Ot8mZ05IM6fhxkAjBNQoX8/zziframehtml1zz.html#%2fStartWithParent%2fappId%2f%2f%2f%2f%2f%2f%2f%2ftrue%2f1.0%2f5%2fMicrosoftAjax.js%2fBasePlayer.js%2fPlayerStrings.js%2fplayer.js%2fStartPlayer.js%2fvideo%253dhttp%253a%252f%252fmsbluelight-0.agappdom.net%252fe1%252fd%252f4147%252f21945620%252f63386409600%252f0.vXOU7_ToWpsxx-IxIDKkNyZ6nHU%252fvideo.wmv">here</a> and <a href="http://msbluelight-0.agappdom.net/e1/d/20709/586316/63386409600/0.cPqT6Ot8mZ05IM6fhxkAjBNQoX8/zziframehtml1zz.html#%2fStartWithParent%2fappId%2f%2f%2f%2f%2f%2f%2f%2ftrue%2f1.0%2f5%2fMicrosoftAjax.js%2fBasePlayer.js%2fPlayerStrings.js%2fplayer.js%2fStartPlayer.js%2fvideo%253dhttp%253a%252f%252fmsbluelight-0.agappdom.net%252fe1%252fd%252f4147%252f22068953%252f63386409600%252f0.xzb0cvzMIE5z7CvvHHJ7F-vkzgo%252fvideo.wmv">here</a>.</p>
<h2>Moving forward</h2>
<p>Now I need to spend some more time digging deeper and really unleashing the power of these physics, testing to see how easy the engine can be used to build rich interactive games. I have a feeling I maybe posting a view more examples using these add-ons. I need to spend some time thinking of some cool and purposeful ways to cross use tools like the <a href="http://farseerphysics.codeplex.com/">Farseer Physics Engine</a>, the <a href="http://wpffx.codeplex.com/">WPFFX pixel shaders</a> and <a href="http://livelabs.com/seadragon/silverlight/">Deep Zoom Composer</a>.</p>
<h2>Grab the example files</h2>
<p><span style="font-weight: normal; font-size: 13px;">As always you can grab the example files <a href="http://www.silverlightbuzz.com/examples/SilverlightPhysics1.zip">here</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2009/08/19/additional-physics-based-behaviors-for-blend-and-silverlight/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Home made Wiimote whiteboard demos Silverlightbuzz!</title>
		<link>http://www.silverlightbuzz.com/2009/08/01/home-made-wiimote-whiteboard-demos-silverlightbuzz/</link>
		<comments>http://www.silverlightbuzz.com/2009/08/01/home-made-wiimote-whiteboard-demos-silverlightbuzz/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 09:49:45 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight Effects]]></category>
		<category><![CDATA[Silverlight News]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Drag]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Projection]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[User Input]]></category>
		<category><![CDATA[Wiimote]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=357</guid>
		<description><![CDATA[Using a Wii controller, a projector and some LEDs, a colleague and fellow Silverlight blogger of mine, Dean Gifford (RocketPanda.com)...]]></description>
			<content:encoded><![CDATA[<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="120" valign="top">
<iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=FFFFFF&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=07B5E7&#038;t=silvebuzz-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;asins=B000IMWK2G" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</td>
</tr>
</tbody>
</table>
<p>Using a Wii controller, a projector and some LEDs, a colleague and fellow Silverlight blogger of mine, Dean Gifford (<a href="http://www.rocketpanda.com">RocketPanda.com</a>) builds a home made interactive whiteboard and demos it using interactions from <a href="http://www.silverlightbuzz.com">silverlightbuzz.com</a>.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/WdhQrEgfxXA&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WdhQrEgfxXA&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/h88KCjyGXNQ&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/h88KCjyGXNQ&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>The two examples from this site were my <a href="http://www.silverlightbuzz.com/2009/06/16/creating-a-3d-cube-with-images-in-silverlight-3/">Interactive 3D Cube</a> and my <a href="http://www.silverlightbuzz.com/2009/03/19/cup-o-salt-silverlight-game-beta-1/">Cup-o-Salt</a> prototype game.</p>
<p>Notice the <a href="http://www.metia.com">Metia</a> sponsored sticky tape holding up the Wii control on the ceiling!</p>
<p>The whole exercise costing only a Wii controller (app. £30) and an LED (under £1) means building your own <a href="http://www.microsoft.com/SURFACE/Pages/Experience/Videos.aspx">Surface table</a> is not that far from being a reality.</p>
<p>You can even get multi-touch working and pressure sensitive values with a little more work, something that I am sure Dean will be looking at next.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2009/08/01/home-made-wiimote-whiteboard-demos-silverlightbuzz/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2 Player tank game built in Silverlight</title>
		<link>http://www.silverlightbuzz.com/2009/04/06/2-player-tank-game-built-in-silverlight/</link>
		<comments>http://www.silverlightbuzz.com/2009/04/06/2-player-tank-game-built-in-silverlight/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 23:34:47 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight News]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Direction]]></category>
		<category><![CDATA[Effects]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Rotation]]></category>
		<category><![CDATA[Silverlight 2]]></category>
		<category><![CDATA[User Input]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=192</guid>
		<description><![CDATA[The below is a 2 player tank game built for the Silverlight 2 plug-in. Players are assigned keys to separate...]]></description>
			<content:encoded><![CDATA[<p>The below is a 2 player tank game built for the Silverlight 2 plug-in. Players are assigned keys to separate sides of the keyboard. Each player will need to master controlling each set of tracks manually and can also turn their turret aiming to shoot one another. Each time a players tank has lost its life it will be reset to its default position and a point awarded to the other player.</p>
<p/>
<a href="http://www.silverlightbuzz.com/silverlightProjects/TanksV1/tanks.html"><img class="alignnone" title="Tanks" src="http://www.silverlightbuzz.com/images/tanks1.jpg" alt="" width="500" height="400" /></a>
<p/>
<p>This game has been submitted to the Mashooo Silverlight game competition at www.mashooo.com.</p>
<p><a href="http://www.silverlightbuzz.com/silverlightProjects/TanksV1/tanks.html">Click one of the screen shots or here to play! </a></p>
<p><a href="http://www.silverlightbuzz.com/silverlightProjects/TanksV1/tanks.html"><img class="alignnone" title="Tanks" src="http://www.silverlightbuzz.com/images/tanks2.jpg" alt="" width="500" height="400" /></a></p>
<p><a href="http://www.silverlightbuzz.com/silverlightProjects/TanksV1/tanks.html"><img class="alignnone" title="Tanks" src="http://www.silverlightbuzz.com/images/tanks3.jpg" alt="" width="500" height="400" /></a></p>
<h2>Future improvements</h2>
<p>I plan on adding random power ups that can be picked up by driving into them. Power ups can include Increase to rate of fire, increase to fire power, increase to health, increase to speed, shields and temporary invincibility.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2009/04/06/2-player-tank-game-built-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Rotation controlled direction using trigonometry and radians in Silverlight</title>
		<link>http://www.silverlightbuzz.com/2009/03/29/rotation-controlled-direction-using-trigonometry-and-radians-in-silverlight/</link>
		<comments>http://www.silverlightbuzz.com/2009/03/29/rotation-controlled-direction-using-trigonometry-and-radians-in-silverlight/#comments</comments>
		<pubDate>Sun, 29 Mar 2009 15:22:02 +0000</pubDate>
		<dc:creator>Gavin Wignall</dc:creator>
				<category><![CDATA[All Silverlight Examples]]></category>
		<category><![CDATA[Silverlight 2 tutorials]]></category>
		<category><![CDATA[Silverlight C# Tutorials]]></category>
		<category><![CDATA[Silverllight Games]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Direction]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Radians]]></category>
		<category><![CDATA[Rotation]]></category>
		<category><![CDATA[Silverlight 2]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[User Input]]></category>

		<guid isPermaLink="false">http://www.silverlightbuzz.com/?p=170</guid>
		<description><![CDATA[The below example shows an object being controlled by user input. To get the object to turn left or right...]]></description>
			<content:encoded><![CDATA[<p>The below example shows an object being controlled by user input. To get the object to turn left or right is a relatively simple procedure as seen below:</p>
<p><em>if (e.Key == Key.Left)<br />
{<br />
      </em><span style="color: #ff0000;"><strong><em>tankRotate.Angle -= 1;</em></strong></span><em><br />
}<br />
if (e.Key == Key.Right)<br />
{<br />
      </em><span style="color: #ff0000;"><strong><em>tankRotate.Angle += 1;</em></strong></span><em><br />
}</em><br />
<div class="iframe-wrapper">
  <iframe src="http://www.silverlightbuzz.com/silverlightProjects/RotationDirection/TestPage.html" frameborder="0" style="height:400px;width:500px;">Please upgrade your browser</iframe>
</div><br />The above example turns the object by 1 degree left or 1 degree right, you can use any value to make the object turn faster or slower.</p>
<p>To get the object to move forward in the direction it is facing is going to require our old friend &#8216;Trig&#8217; to take center stage. We can use the following formulae to calculate how far to move our object by its X and Y co-ordinates:</p>
<p><strong><span style="color: #ff0000;"><span style="color: #000000;"><span style="font-weight: normal;">Move X by:</span></span> Math.Cos(Angle) * Speed</span></strong></p>
<p><strong><span style="color: #ff0000;"><span style="color: #000000;"><span style="font-weight: normal;">Move Y by:</span></span> Math.Sin(Angle) * Speed</span></strong></p>
<p>Where <span style="color: #ff0000;"><strong>Angle </strong></span>is in radians.</p>
<h2>Radians</h2>
<p>1 radian is equal to 57.29577 degrees of a full circle. So if our object is turned at an angle of 57.29577 degrees it is equal to 1 radian. To work out the value of our angle in radians we can use the following formula:</p>
<p><span style="color: #ff0000;"><strong><span style="color: #000000;"><span style="font-weight: normal;">Radians =</span></span> Angle / 360 * 2 * Pi</strong></span></p>
<h2>Working out how much to move our object</h2>
<p><span style="color: #ff0000;"><em><span style="color: #000000;">i.e. <span style="font-style: normal;">if our object is turned to <span style="color: #ff0000;">45 </span>degrees and our required movement speed is <span style="color: #ff0000;">2</span>.</span></span></em></span></p>
<p><span style="color: #ff0000;"><em><span style="color: #000000;"></span></em></span></p>
<p><span style="color: #ff0000;"><strong>X += Math.Cos(45 / 360 * 2 * 3.14159) * 2;</strong></span></p>
<p><span style="color: #ff0000;"><strong>Y += Math.Sin(45 / 360 * 2 * 3.14159) * 2;</strong></span></p>
<h2><span style="color: #000000;">Applying this formula to the C#</span></h2>
<p>So to return to the example at the begining of this post. I use the below calculations to work out how much to increase or decrease the X and Y positions of my object:</p>
<p><em>if (e.Key == Key.Up) </em></p>
<p><em>{</em></p>
<p><span style="color: #ff0000;"><strong><em>        tankMovement.X += Math.Cos(tankRotate.Angle / 360 * 2 * 3.14159) * 1;</em></strong></span></p>
<p><span style="color: #ff0000;"><strong><em>        tankMovement.Y += Math.Sin(tankRotate.Angle / 360 * 2 * 3.14159) * 1;</em></strong></span></p>
<p><em>}</em></p>
<h2>Get the code</h2>
<p>Feel free to grab the <a href="http://www.silverlightbuzz.com/examples/RotationControlledDirection.zip">code here</a> and start playing!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightbuzz.com/2009/03/29/rotation-controlled-direction-using-trigonometry-and-radians-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

