<?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>Flash Monkey</title>
	<atom:link href="http://www.flashmonkey.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.flashmonkey.co.uk</link>
	<description>Stephen Burgess - Interactive Developer</description>
	<lastBuildDate>Tue, 13 Mar 2012 21:56:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>HTML5 Space Monkey</title>
		<link>http://www.flashmonkey.co.uk/html5-space-monkey/</link>
		<comments>http://www.flashmonkey.co.uk/html5-space-monkey/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 17:28:19 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Physics]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1310</guid>
		<description><![CDATA[After finishing at Specialmoves last week I now have a few weeks off before moving to New York and getting started at Fi, so plenty of time to work on all the little experiments and ideas I&#8217;ve had recently. I&#8217;ve &#8230; <a href="http://www.flashmonkey.co.uk/html5-space-monkey/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flashmonkey.co.uk/html5/spacemonkey/"><img src="http://flashmonkey.co.uk/images/spacemonkey/html5spacemonkey.png"></a></p>
<p>After finishing at <a href="http://http://specialmoves.com/">Specialmoves</a> last week I now have a few weeks off before moving to New York and getting started at <a href="http://www.f-i.com/">Fi</a>, so plenty of time to work on all the little experiments and ideas I&#8217;ve had recently.</p>
<p>I&#8217;ve been really enjoying playing around with HTML5 and thought it would be a nice challenge to re-write my Flash Space Monkey game using only HTML5, JavaScript and CSS. I&#8217;m really happy with the result and it even works quite nicely on iOS, where you can control the game by tilting your iPhone/iPad from left to right, taking advantage of JavaScript&#8217;s native device orientation events.</p>
<p>The character is made up of nested dom elements and is controlled by CSS3 transitions. The platforms are transparent PNGs drawn to a canvas element.</p>
<p><img src="http://flashmonkey.co.uk/images/spacemonkey/assets.png"></p>
<p>I was originally thinking of creating the game using some of the many great JavaScript libraries available but ended up just using a bit of <a href="http://jquery.com/">JQuery</a> (of course) and also <a href="http://http://requirejs.org/">RequireJS</a>, which I found really useful.</p>
<p>It&#8217;s only been tested on a limited amount of devices so any feedback on performance is welcomed. Also, since I&#8217;m still relatively new to extensive JS and CSS, any tips on how I could do things better in the future would be cool too. <a href="http://www.flashmonkey.co.uk/html5/spacemonkey/">Enjoy the game</a> and see if you can beat my high score of 20,000+!!!</p>
<p><a href="http://www.flashmonkey.co.uk/html5/spacemonkey/"><img src="http://flashmonkey.co.uk/images/spacemonkey/screenshot.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/html5-space-monkey/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Monkey is moving to New York!</title>
		<link>http://www.flashmonkey.co.uk/flash-monkey-is-moving-to-new-york/</link>
		<comments>http://www.flashmonkey.co.uk/flash-monkey-is-moving-to-new-york/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 10:05:20 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[Employment]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1298</guid>
		<description><![CDATA[Ever since I was a kid I&#8217;ve been drawn to the New York, probably because it&#8217;s so romanticised in American films. However, it wasn&#8217;t until the end of last year that I finally made a trip over to the Big &#8230; <a href="http://www.flashmonkey.co.uk/flash-monkey-is-moving-to-new-york/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ever since I was a kid I&#8217;ve been drawn to the New York, probably because it&#8217;s so romanticised in American films. However, it wasn&#8217;t until the end of last year that I finally made a trip over to the Big Apple to visit some friends, one of which had recently started work at <a href="http://www.f-i.com/">Fi</a>.</p>
<p>I&#8217;ve known about Fi for many years due to the amount of awards they have won and the brilliant work they continuously produce. More recently they have started to focus on creating cool HTML5 stuff and have amazing clients like <a href="http://www.f-i.com/work/google/googles-20-things">Google</a> and <a href="http://www.f-i.com/htc/global/">HTC</a>. So I thought while I was over in NY I&#8217;d send them my CV and see if I could wangle a position there. Much to my delight, they gave me a job! A big thanks must go to my mates <a href="http://www.idrawboxes.com/">Chris Sainsbury</a> and <a href="http://darcyclarke.me/">Darcy Clarke</a> for passing on my CV and getting me through the door for an interview.</p>
<p>I&#8217;m very excited about joining such a great company and working with some great developers. I&#8217;m due to fly out and start my new job in mid March so I have a few weeks to relax (and maybe do a bit of coding!) If you&#8217;re a reader of the site and live in the city please send over an email, it would be great to hear from you.</p>
<p>I also want to say a huge thanks to <a href="http://www.specialmoves.com/">Specialmoves</a> who I have left in pursuit of the American dream. It really is a great company and even though I was only there for a relatively short time I learnt loads and made some great friends. I’m sad to be leaving such a great company prematurely, but really excited about my new adventure with Fi in New York.</p>
<p><img src="http://www.flashmonkey.co.uk/images/nyfm.jpg"></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/flash-monkey-is-moving-to-new-york/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML5 Collage Creator Prototype</title>
		<link>http://www.flashmonkey.co.uk/html5-collage-creator-prototype/</link>
		<comments>http://www.flashmonkey.co.uk/html5-collage-creator-prototype/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 01:45:34 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1289</guid>
		<description><![CDATA[I&#8217;m still relatively new to using JavaScript and CSS extensively and I&#8217;m learning new stuff every day. The benefit is obvious &#8211; I&#8217;m getting better at it. The bad thing though is that every time I create something new it &#8230; <a href="http://www.flashmonkey.co.uk/html5-collage-creator-prototype/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still relatively new to using JavaScript and CSS extensively and I&#8217;m learning new stuff every day. The benefit is obvious &#8211; I&#8217;m getting better at it. The bad thing though is that every time I create something new it sort of makes me a little embarrassed of the last thing I made.</p>
<p>That is sort of the case with this one. I made this at the end of last year and intend, at some point in the future, to further develop it into a really nice little app that will dynamically take any image and create a collage with it, much like <a href="http://www.flashmonkey.co.uk/collagecreator/">my original flash version</a> I made a couple of years ago.</p>
<p>For now though this is just a prototype, a proof of concept if you like. The data is hard coded (generated from the flash version) but the images are loaded from Flickr and I have the interactive side of it working nicely (click an image to zoom into it).</p>
<p>All the transitions are done using CSS transforms and simple easing algorithms in JavaScript. It works pretty well on mobile devices too. I&#8217;ve had it running smoothly on an iPhone, iPad and a couple Android devices. Go ahead and play around with it <a href="http://www.flashmonkey.co.uk/lab/collage-gallery/">here</a>.</p>
<p>All the code is commented so check out the source, although like I said I&#8217;d probably do things very differently if I was to write it again.</p>
<p><a href="http://www.flashmonkey.co.uk/lab/collage-gallery/"><img src="http://www.flashmonkey.co.uk/images/collage-gallery-screenshot-1.jpg"></a><br />
<a href="http://www.flashmonkey.co.uk/lab/collage-gallery/"><img src="http://www.flashmonkey.co.uk/images/collage-gallery-screenshot-2.jpg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/html5-collage-creator-prototype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SWFAddress not updating on a Mac</title>
		<link>http://www.flashmonkey.co.uk/swfaddress-not-updating-on-a-mac/</link>
		<comments>http://www.flashmonkey.co.uk/swfaddress-not-updating-on-a-mac/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 09:25:03 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[ActionScript]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1280</guid>
		<description><![CDATA[At Specialmoves we maintain a very large multi-lingual Flash site for a luxury brand. As part of a recent update we noticed that there appeared to be some issues with the url and title of the browser not updating. It &#8230; <a href="http://www.flashmonkey.co.uk/swfaddress-not-updating-on-a-mac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://www.specialmoves.com">Specialmoves</a> we maintain a very large multi-lingual Flash site for a luxury brand. As part of a recent update we noticed that there appeared to be some issues with the url and title of the browser not updating. It was only certain pages and happened in most languages. The problem became even stranger when we realised that it was only happening on Macs.</p>
<p>After a little debugging I soon found the issue. SWFAddress actually does a check to detect the OS and calls JavaScript functions differently on a Mac. On Windows (and other Operating Systems) SWFAddress uses <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html#call()">ExternalInterface</a> to call JavaScript functions. However, on a Mac it sends a string of JavaScript to the browser by using <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateToURL()">NavigateToURL</a>.</p>
<p>Why the difference? I’m not sure to be honest but I presume it may be something to do with making multiple calls in quick succession with ExternalInterface.call() not working in some browsers on a Mac? That’s just a guess though and I don’t have time to do tests and find out the definite reason. The difference is mentioned in <a href="http://www.asual.com/blog/swfaddress/swfaddress-23.html">this old blog post</a> on the Asual site but there is no explanation given why.</p>
<p>Anyway, back to why it was not updating on certain pages for our site update. The issue was that some of the translators had accidentally added a carriage return to the title on some pages. Probably caused from copying and pasting from an Excel or Word document. This carriage return was fine when using ExternalInterface but using NavigateToURL it meant the JavaScript was not valid and therefore never gets called.</p>
<p>The fix was simple, I changed this line in our code:</p>
<div class="codecolorer-container actionscript3 " style="overflow:auto;white-space:nowrap;width:600px"><div class="actionscript3 codecolorer" style="font-family:Monaco,Lucida Console,monospace">SWFAddress.setTitle<span class="br0">&#40;</span>browserUpdateVO.title<span class="br0">&#41;</span>;</div></div>
<p>to this:</p>
<div class="codecolorer-container actionscript3 " style="overflow:auto;white-space:nowrap;width:600px"><div class="actionscript3 codecolorer" style="font-family:Monaco,Lucida Console,monospace">SWFAddress.setTitle<span class="br0">&#40;</span><span class="kw7">encodeURI</span><span class="br0">&#40;</span><span class="kw7">decodeURI</span><span class="br0">&#40;</span>browserUpdateVO.title<span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="kw7">split</span><span class="br0">&#40;</span><span class="st0">&quot;%0D&quot;</span><span class="br0">&#41;</span>.<span class="kw7">join</span><span class="br0">&#40;</span><span class="st0">&quot;&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div></div>
<p>This removes any carriage returns and ensures the JavaScript will be called successfully. </p>
<p>I think this is perhaps a little flaw with SWFAddress. Sure we developers should ensure we’re sending a title or URL without a carriage return. However, there is no way that the JavaScript will work with NavigateToURL if it contains a carriage return, so I think it wouldn’t hurt for there to be a little check within SWFAddress. I have contacted Asual and suggested this for the next code release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/swfaddress-not-updating-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some thoughts on the future of Flash</title>
		<link>http://www.flashmonkey.co.uk/some-thoughts-of-the-future-of-flash/</link>
		<comments>http://www.flashmonkey.co.uk/some-thoughts-of-the-future-of-flash/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 15:19:33 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1253</guid>
		<description><![CDATA[It&#8217;s that time of the year again when people write off Flash saying this year really is the end of flash with HTML5* taking over the world. I&#8217;m not so sure and here are my thoughts why. Regular readers may &#8230; <a href="http://www.flashmonkey.co.uk/some-thoughts-of-the-future-of-flash/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s that time of the year again when people write off Flash saying <i>this</i> year really <i>is</i> the end of flash with HTML5* taking over the world. I&#8217;m not so sure and here are my thoughts why.</p>
<p>Regular readers may have noticed over the past year or so an increase in HTML5, JavaScript and CSS experiments on this site and a lot less Flash. In fact I will soon be officially changing my day to day role to work almost exclusively with these technologies and much less (if at all) with Flash. More on that sometime soon.</p>
<p>However, my reason for jumping the Flash ship like Captain Schettino is not because I think it is going to sink and this year everything will be done in HTML5. I&#8217;ve been working almost exclusively with Flash and ActionScript for over 7 years now and I feel like it’s the right time for a change. It will be nice to add some new feathers to my programming hat and I will definitely sit more comfortably at work knowing I have more languages to call on to solve problems.</p>
<p>I don&#8217;t think it&#8217;s all doom and gloom for Flash though, in fact I believe Flash leads where HTML follows. Sure you can do a lot of stuff now in JS/CSS that you used to only really be able to do effectively in the browser with Flash; but Flash is still moving forward and you only have to look at audio stuff to see that. AS3&#8242;s SoundMixer Class enables you to do all sorts of cool stuff with audio (for example <a href="http://lf8.org/simple2.swf">this from trioptic</a>) whereas HTML5’s audio tag still has some short comings. <a href="http://nerdplusart.com/why-is-there-flash-in-the-html5-version-of-cut-the-rope">This article</a> about the recent HTML5 Cut the Rope games explains more. Let’s not forget the HTML5 specification is still a working draft and <a href="http://en.wikipedia.org/wiki/HTML5">2014 is the target date for recommendation by the WC3</a>.</p>
<p>HTML5 specs have to be agreed upon and implemented across many different browsers and platforms and even then there will always be some differences and quirks. Flash can move much faster as it’s only one platform, and in theory should work the same across all browsers.</p>
<p>Another big plus for Flash at the moment is the ability to compile for different devices such as iOS and Android using <a href="http://www.adobe.com/products/air.html">AIR</a>. I recently had to give some rough costings for a Mobile app to run on multiple operating systems (despite having never built such an application) and recommended AIR as a potential platform to develop in. I’m sure there are some issues with using this technique, possibly like <a href="http://usingimho.wordpress.com/2011/06/14/why-you-should-stay-away-from-appcelerators-titanium/">similar technologies such as appcelarator suffer from</a>, but it seems like it could be a good option.</p>
<p>I think consumers don&#8217;t really care what technology is used as long as it works. The only people who are getting excited (or scared as some Flash Devs I know) about HTML5 are us Developers. Imagine Joe average Internet user viewing my recent <a href="http://www.flashmonkey.co.uk/css-javascript-pacman/">Pacman demo</a> &#8211; they would think it&#8217;s pretty crap really, and maybe rightly so. They have seen amazing 3D Flash games so why would they care about a rubbish 2D prototype just because it runs in the browser on an iPad.</p>
<p>Also, do we really need browser games on iOS with the app store already offering so many great games? Although, maybe that’s not the point. I think in the immediate future HTML5 will be mostly used for UI stuff, replacing Flash for user interaction stuff like the simple example I created below.</p>
<div style="text-align: center;">
<iframe style="border: none;" name="example" src="http://flashmonkey.co.uk/widget/rolloverimage/index.html?paths=main.png,../../images/nythumbs/image1.jpg,../../images/nythumbs/image2.jpg,../../images/nythumbs/image3.jpg,../../images/nythumbs/image4.jpg,../../images/nythumbs/image5.jpg" width="240" height="180"<br />
frameborder="0" scrolling="auto" name="myInlineFrame"><br />
<img src="main.png"></iframe>
</div>
<p>Anyway, I’m really having fun using JavaScript more and more. Sure it has it’s quirks, and can at times feel like a step back from AS3. But it’s interesting seeing what you can do in a browser without a plugin and overcoming new challenges JS throws up for me. Every JS project I work on I feel like I’m learning loads and it’s an exciting time.</p>
<p>It&#8217;s also nice not having to compile a SWF every time you want to make a little change, pressing cmd+R is so refreshing. I’ll leave it on that poor joke &#8211; all comments from Flash devs who are moving in the same direction as me, and also those not, are really welcomed as always.</p>
<p><small>* To quote <a href="http://twitter.com/photonstorm">Richard Davey</a> from his recent <a href="http://www.photonstorm.com/archives/2759/the-reality-of-html5-game-development-and-making-money-from-it">blog post about HTML5 Games</a> (well worth a read) &#8211; &#8220;When I talk about “HTML5” I’m doing so from the popular media use of the word, rather than the technical one. On a technical level HTML5 is of course just a specification for a mark-up language. But the media has chosen to use the term as an umbrella, spanning lots of browser related technologies&#8230;&#8221;</small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/some-thoughts-of-the-future-of-flash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS &amp; JavaScript Pacman</title>
		<link>http://www.flashmonkey.co.uk/css-javascript-pacman/</link>
		<comments>http://www.flashmonkey.co.uk/css-javascript-pacman/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 10:33:45 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Experiment]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1207</guid>
		<description><![CDATA[Anyone who has been on this site recently will know I’ve been playing around with a lot of little JavaScript and Canvas experiments. I’ve had fun porting some of my old Flash stuff over to Canvas and some of them &#8230; <a href="http://www.flashmonkey.co.uk/css-javascript-pacman/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Anyone who has been on this site recently will know I’ve been playing around with a lot of little JavaScript and Canvas experiments. I’ve had fun porting some of my old Flash stuff over to Canvas and some of them have generated a fair bit of interest with my <a href="http://flashmonkey.co.uk/html5/colorwall/">HTML5 ColorWall</a> featured on <a href="http://www.chromeexperiments.com/detail/colorwall/">Chrome Experiments</a> (go and vote for it!) and my <a href="www.flashmonkey.co.uk/simple-javascript-physics/">Simple JavaScript Physics post</a> getting a lot of hits.</p>
<p>One thing I’ve found frustrating is how poorly these experiments run on iOS, especially before the recently released iOS5. Apple are against adding web plugins, such as Adobe Flash, to their devices claiming people should be using HTML5 tags such as Canvas. However, constantly clearing and re-drawing to a Canvas element on an iPhone running iOS4 gives you about 3 or 4 fps (it’s slightly better on iOS5 but still not good enough to write a game).</p>
<p>I then stumbled across <a href="http://sebleedelisle.com/2011/04/html5javascript-platform-game-optimised-for-ipad/">this article</a> on <a href="http://sebleedelisle.com/about/">Seb Lee-Delisles</a> site about a JavaScript hack day they held at <a href="http://www.pluginmedia.net/">Plugin Media</a> where they made <a href="http://www.pluginmedia.net/dev/infector/">the infector game</a> using CSS and JavaScript to see if they could get a fast browser game running on iOS. Inspired by this and wanting to learn a bit more CSS/JavaScript I decided to try putting my own game together using the same techniques. This post will explain how I went about it and stuff I learnt.</p>
<p>Before I continue I should mention that this isn’t a full version of Pacman, it’s merely a prototype to see if I could get a browser game working smoothly on an iPad and other touch devices. I never intended to finish it fully as I feel the world already has enough Pacman games floating about and we don’t really need another one. I am planning on creating a more original game with a Designer friend of mine early next year and will post about that when it’s ready.</p>
<p>First up <a href="http://www.flashmonkey.co.uk/lab/pacman/">click here to play the game</a>. Right click and have a glance over the source code then read on below and I’ll explain the main talking points of the game structure.</p>
<p><a href="http://www.flashmonkey.co.uk/lab/pacman/"><img src="http://www.flashmonkey.co.uk/images/pacman/game.png"></a></p>
<h2>Moving and animating the characters</h2>
<p>The movement of the characters is fairly simple. The <a href="http://www.flashmonkey.co.uk/lab/pacman/js/Player.js">Player</a> and <a href="http://www.flashmonkey.co.uk/lab/pacman/js/Ghost.js">Ghost</a> Classes (I’m going to call them Classes even though they aren’t strictly Classes, not in the way AS3 Developers would be used to anyway) both contain an instance of the Animation Class. This Class was adapted from the Plugin Media experiment and basically uses CSS transforms to position the game characters as seen in the code below. I updated the Class so it also incorporated rotation, which I needed for my Pacman game.</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:600px"><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">var</span> xp <span class="sy0">=</span> Math.<span class="me1">round</span><span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">x</span> <span class="sy0">+</span> <span class="kw1">this</span>.<span class="me1">offsetX</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> yp <span class="sy0">=</span> Math.<span class="me1">round</span><span class="br0">&#40;</span><span class="kw1">this</span>.<span class="me1">y</span> <span class="sy0">+</span> <span class="kw1">this</span>.<span class="me1">offsetY</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
styleStr <span class="sy0">=</span> <span class="st0">&quot;translate(&quot;</span> <span class="sy0">+</span> xp <span class="sy0">+</span> <span class="st0">&quot;px, &quot;</span> <span class="sy0">+</span> yp <span class="sy0">+</span> <span class="st0">&quot;px)&quot;</span><span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">webkitTransform</span> <span class="sy0">=</span> styleStr<span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">MozTransform</span> <span class="sy0">=</span> styleStr<span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">OTransform</span> <span class="sy0">=</span> styleStr<span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">transform</span> <span class="sy0">=</span> styleStr<span class="sy0">;</span><br />
<br />
styleStr <span class="sy0">=</span> <span class="st0">&quot;rotate(&quot;</span> <span class="sy0">+</span> <span class="kw1">this</span>.<span class="me1">rotation</span> <span class="sy0">+</span> <span class="st0">&quot;deg)&quot;</span><span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">webkitTransform</span> <span class="sy0">+=</span> styleStr<span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">MozTransform</span> <span class="sy0">+=</span> styleStr<span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">OTransform</span> <span class="sy0">+=</span> styleStr<span class="sy0">;</span><br />
dom.<span class="me1">style</span>.<span class="me1">transform</span> <span class="sy0">+=</span> styleStr<span class="sy0">;</span></div></div>
<p>The character animations are done using simple Sprite sheets as seen below.</p>
<p><img src="http://www.flashmonkey.co.uk/images/pacman/sprite_sheets.png"></p>
<p>I liked the way Plugin Media wrote their Animation Class so the API worked in a similar way to ActionScript with play(), stop() and gotoAndStop() functions. View my adapted version of the Class <a href="http://www.flashmonkey.co.uk/lab/pacman/js/Animation.js">here</a>.</p>
<h2>Collision Detection / Level Generator</h2>
<p>The hit detection for when Pacman touches a wall is actually very simple. The level background is a transparent png as shown below.</p>
<p><img src="http://www.flashmonkey.co.uk/images/pacman/level.png"></p>
<p>I create a Canvas element and give it a green background. I then load the image on top of it, divide the image up into a grid and loop through to check if the pixel color is green using <i>&#8220;getImageData&#8221;</i> with the canvas tag. If it is I know it’s a space, otherwise it’s a wall. From this I can create an Array with info on the level and I use this throughout the game.</p>
<p>To see the full Level Class where this Array is generated click <a href="http://www.flashmonkey.co.uk/lab/pacman/js/Level.js">here</a>. You may remember me criticising the performance of the Canvas tag and be wondering why I am using it. It only performs badly when you are constantly clearing it and writing to it. Once graphics have been written to Canvas it’s performance is no better or worse than simply loading an image.</p>
<p>If you have downloaded the source and are running it locally you may find that it doesn’t work and you get a security error. That is due to the line of code below – <i>&#8220;getImageData&#8221;</i>. You won’t get this if you install and run a local webserver such as Apache – this <a href="http://stackoverflow.com/questions/358538/getimagedata-in-firefox-3-causing-ns-error-dom-security-err">post on stackoverflow</a> will explain further.</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:600px"><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace">cellData<span class="br0">&#91;</span>w<span class="br0">&#93;</span><span class="br0">&#91;</span>h<span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#40;</span>context.<span class="me1">getImageData</span><span class="br0">&#40;</span>xp<span class="sy0">,</span> yp<span class="sy0">,</span> <span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">1</span><span class="br0">&#41;</span>.<span class="me1">data</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span> <span class="sy0">==</span> <span class="nu0">255</span><span class="br0">&#41;</span> <span class="sy0">?</span> <span class="nu0">1</span> <span class="sy0">:</span> <span class="nu0">0</span><span class="sy0">;</span></div></div>
<p>The second bit of collision detection is between Pacman and the Ghost. This was much simpler and is done using a distance calculation.</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:600px"><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">var</span> dx <span class="sy0">=</span> Math.<span class="me1">abs</span><span class="br0">&#40;</span>player.<span class="me1">xp</span> <span class="sy0">-</span> ghost.<span class="me1">xp</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> dy <span class="sy0">=</span> Math.<span class="me1">abs</span><span class="br0">&#40;</span>player.<span class="me1">yp</span> <span class="sy0">-</span> ghost.<span class="me1">yp</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="kw2">var</span> dist <span class="sy0">=</span> Math.<span class="me1">sqrt</span><span class="br0">&#40;</span>dx <span class="sy0">*</span> dx <span class="sy0">+</span> dy <span class="sy0">*</span> dy<span class="br0">&#41;</span><span class="sy0">;</span><br />
<br />
<span class="kw1">if</span><span class="br0">&#40;</span>dist <span class="sy0">&lt;</span> CELL_SIZE<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; onGameOver<span class="br0">&#40;</span><span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div></div>
<p>For the Ghost AI I have written a simple implementation of the good old <a href="http://en.wikipedia.org/wiki/A*_search_algorithm">A* algorithm</a>. <a href="http://www.bit-101.com/blog/">Keith Peters</a> wrote a great chapter on pathfinding in his <a href="http://www.amazon.com/AdvancED-ActionScript-Animation-Keith-Peters/dp/1430216085/ref=pd_bxgy_b_img_b">ActionScript 3.0 Advanced Animation book</a>, which is well worth a read if you’re completely new to pathfinding. A* is by far the most used pathfinding algorithm. You’ll find it being used from simple games like Pacman right up to complex PS3/Xbox games. You can see my implementation in the updateGhost function within the index.html source.</p>
<h2>Touch screen devices</h2>
<p>For the touch screen controls I used <a href="http://www.modernizr.com/">Modernizr</a> to detect if the device supports touch.</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:600px"><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">if</span><span class="br0">&#40;</span>Modernizr.<span class="me1">touch</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; isTouch <span class="sy0">=</span> <span class="kw2">true</span><span class="sy0">;</span><br />
&nbsp; makeControls<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div></div>
<p>Then I create onscreen controls using divs and the HTML touch events. I combined the event listener for key presses and touches as shown below.</p>
<div class="codecolorer-container javascript " style="overflow:auto;white-space:nowrap;width:600px"><div class="javascript codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">function</span> onKeyPress<span class="br0">&#40;</span>e<span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span>isPlaying <span class="sy0">&amp;&amp;</span> <span class="sy0">!</span>isKeyDown<span class="br0">&#41;</span> onClicked<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
&nbsp; isKeyDown <span class="sy0">=</span> <span class="br0">&#40;</span>isTouch<span class="br0">&#41;</span> <span class="sy0">?</span> <span class="br0">&#40;</span>e.<span class="me1">type</span> <span class="sy0">==</span> <span class="st0">&quot;touchstart&quot;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="br0">&#40;</span>e.<span class="me1">type</span> <span class="sy0">==</span> <span class="st0">&quot;keydown&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span> &nbsp; <br />
&nbsp; <br />
&nbsp; <span class="kw1">switch</span><span class="br0">&#40;</span><span class="br0">&#40;</span>isTouch<span class="br0">&#41;</span> <span class="sy0">?</span> e.<span class="me1">target</span> <span class="sy0">:</span> e.<span class="me1">keyCode</span><span class="br0">&#41;</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">case</span> KEY_LEFT <span class="sy0">:</span><br />
&nbsp; &nbsp; <span class="kw1">case</span> leftButton <span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; leftDown <span class="sy0">=</span> isKeyDown<span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">case</span> KEY_RIGHT <span class="sy0">:</span><br />
&nbsp; &nbsp; <span class="kw1">case</span> rightButton <span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; rightDown <span class="sy0">=</span> isKeyDown<span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">case</span> KEY_UP <span class="sy0">:</span><br />
&nbsp; &nbsp; <span class="kw1">case</span> upButton <span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; upDown <span class="sy0">=</span> isKeyDown<span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">case</span> KEY_DOWN <span class="sy0">:</span><br />
&nbsp; &nbsp; <span class="kw1">case</span> downButton <span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; downDown <span class="sy0">=</span> isKeyDown<span class="sy0">;</span><br />
&nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span><br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div></div>
<h2>Fixed timestep</h2>
<p>The final issue I experienced was a noticeable difference in frame rate between certain browsers and devices. This is an expected issue when running game physics on an interval and there is a simple solution: fix your timestep! I won’t go too much into this as you can read all you need to know in this <a href="http://gafferongames.com/game-physics/fix-your-timestep/">great article from Glenn Fiedler</a>. I have written an implementation of what is described in Glenn’s article in JavaScript and the game now runs at pretty much the same speed across all browsers and devices, it’s just smoother on some.</p>
<p>So with a fixed timestep and using CSS transformations on divs rather than constantly writing to Canvas I have succeeded in creating a simple browser based game that runs at an optimum speed on an iPhone/iPad and across other devices such as Android phones.</p>
<h2>Conclusion</h2>
<p>I really enjoyed creating this and learnt a lot about JavaScript and CSS. Reading books/online articles is a great way to learn but sometimes you just need to get stuck into code, and what better way than to make a simple game.</p>
<p>I want to say a little thanks to <a href="http://www.pluginmedia.net/">Seb and the guys at Plugin Media</a> whose code I used a bit of. Also, my current employers <a href="http://specialmoves.com/">Specialmoves</a>, who were happy for me to do a bit of work on the game during my downtime. Finally, thanks to <a href="http://richardhallows.com/">Richard Hallows</a> who gave me some advice on CSS and best practises (check out my alphabetically ordered CSS style sheet).</p>
<p><!--Check out the below video of the game running on my iPhone. Impressive speed huh! -->Go ahead and try it out on your phone and let me know if you have any issues. As always advice and comments are welcome so let me know what you think.</p>
<p><!--VIDEO--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/css-javascript-pacman/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Star Particles</title>
		<link>http://www.flashmonkey.co.uk/star-particles/</link>
		<comments>http://www.flashmonkey.co.uk/star-particles/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 14:20:55 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Physics]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1203</guid>
		<description><![CDATA[Two posts in two days! Just made a star version of the fun particle thing I made yesterday! Check it out here. The stars are drawn with code &#8211; check the source code to see how. I&#8217;ve got a few &#8230; <a href="http://www.flashmonkey.co.uk/star-particles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Two posts in two days! Just made a star version of the fun particle thing I made yesterday! <a onclick="pageTracker._trackEvent('Internal Link', 'Click', 'http://www.flashmonkey.co.uk/lab/js-particles/stars/');" href="http://www.flashmonkey.co.uk/lab/js-particles/stars/" target="_blank">Check it out here.</a> The stars are drawn with code &#8211; check the source code to see how. I&#8217;ve got a few other ideas for these little particles so watch this space! <img src='http://www.flashmonkey.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a onclick="pageTracker._trackEvent('Internal Link', 'Click', 'http://www.flashmonkey.co.uk/lab/js-particles/stars/');" href="http://www.flashmonkey.co.uk/lab/js-particles/stars/" target="_blank"><img src="http://www.flashmonkey.co.uk/lab/js-particles/stars/stars.png" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/star-particles/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fun with JavaScript and particles</title>
		<link>http://www.flashmonkey.co.uk/fun-with-javascript-and-particles/</link>
		<comments>http://www.flashmonkey.co.uk/fun-with-javascript-and-particles/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 16:18:40 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[Experiment]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Physics]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1173</guid>
		<description><![CDATA[So since my last post exactly 2 months ago it&#8217;s remained fairly quiet on the site. The reason being that I&#8217;m currently tech lead on a big project at Specialmoves that is due to go live really soon (more on &#8230; <a href="http://www.flashmonkey.co.uk/fun-with-javascript-and-particles/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So since my last post exactly 2 months ago it&#8217;s remained fairly quiet on the site. The reason being that I&#8217;m currently tech lead on a big project at <a href="http://specialmoves.com/" target="_blank">Specialmoves</a> that is due to go live really soon (more on that later). However, I&#8217;ve had a rare quiet weekend and somehow found the motivation to fire up the Macbook and write some code.</p>
<p>The project I&#8217;m currently working on features a fair amount of particles (it&#8217;s a Christmas site, need I say more). For the vast majority of them I&#8217;ve used <a href="http://www.richardlord.net/blog" target="_blank">Richard Lord&#8217;s</a> brilliant <a href="http://flintparticles.org/" target="_blank">Flint library</a> but there was a couple of loaders on the site where I used my own simple particle system. I&#8217;ve always enjoyed playing around with particles as you can see from the posts featured on this blog, e.g. <a href="http://www.flashmonkey.co.uk/colorwall/" target="_blank">ColorWall</a>, <a href="http://www.flashmonkey.co.uk/wobblewall/" target="_blank">WobbleWall</a> and <a href="http://www.flashmonkey.co.uk/simple-javascript-physics/" target="_blank">Simple JavaScript Physics</a>.</p>
<p>So with yesterday being November 5th (bonfire night here in the UK) I started playing around with creating a sparkler effect using JavaScript and Canvas. It didn&#8217;t really look exactly how I hoped but in creating it I stumbled across some other cool effects, the best being the one below. <a onclick="pageTracker._trackEvent('Internal Link', 'Click', 'http://www.flashmonkey.co.uk/lab/js-particles/bouncy-dir/');" href="http://www.flashmonkey.co.uk/lab/js-particles/bouncy-dir/" target="_blank">Click here to view the particles in action</a>, move your mouse around and click anywhere on the screen.</p>
<p><a href="http://www.flashmonkey.co.uk/lab/js-particles/bouncy-dir/" target="_blank"><img src="http://www.flashmonkey.co.uk/lab/js-particles/bouncy-dir/particles.png"></a></p>
<p>I&#8217;ve always enjoyed creating simple visual effects that are nice to interact with and fun to watch and I think this one is just that. It&#8217;s a simple effect but I found myself dragging the mouse around for ages playing with it.</p>
<p>I plan to write a simple particle tutorial soon (ambitious for me since I&#8217;m currently averaging 1 post every 4 or so months) where I&#8217;ll explain the basics of creating a simple particle effect. Many developers think particle effect are really hard to create but once you&#8217;ve got the basics down it&#8217;s easy peasy.</p>
<p>Below are some of the other particles experiments I made yesterday. The first is the sort of <a href="http://www.flashmonkey.co.uk/lab/js-particles/sparkle/" target="_blank">sparkler effect</a>. The second <a href="http://www.flashmonkey.co.uk/lab/js-particles/floaty/" target="_blank">a slower more mellow version of the above</a> and finally the <a href="http://www.flashmonkey.co.uk/lab/js-particles/streams/" target="_blank">sparkler effect without the canvas being cleared</a>.</p>
<p><a href="http://www.flashmonkey.co.uk/lab/js-particles/sparkle/" target="_blank"><img src="http://www.flashmonkey.co.uk/lab/js-particles/sparkle/sparkle.png"></a><img src="http://www.flashmonkey.co.uk/lab/js-particles/seperator.png"><a href="http://www.flashmonkey.co.uk/lab/js-particles/floaty/" target="_blank"><img src="http://www.flashmonkey.co.uk/lab/js-particles/floaty/floaty.png"></a><img src="http://www.flashmonkey.co.uk/lab/js-particles/seperator.png"><a href="http://www.flashmonkey.co.uk/lab/js-particles/streams/" target="_blank"><img src="http://www.flashmonkey.co.uk/lab/js-particles/streams/streams.png"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/fun-with-javascript-and-particles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s all gone quiet over there&#8230;</title>
		<link>http://www.flashmonkey.co.uk/its-all-gone-quiet-over-there/</link>
		<comments>http://www.flashmonkey.co.uk/its-all-gone-quiet-over-there/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 09:01:22 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[Employment]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1157</guid>
		<description><![CDATA[Indeed it has all gone quiet over here on the site but not because I&#8217;ve buggered off travelling around the world again, oh no, I&#8217;ve been working hard actually. In fact a lot has changed since my last post way &#8230; <a href="http://www.flashmonkey.co.uk/its-all-gone-quiet-over-there/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Indeed it has all gone quiet over here on the site but not because I&#8217;ve buggered off travelling around the world again, oh no, I&#8217;ve been working hard actually. In fact a lot has changed since my last post way back in mid March.</p>
<p>I have a new job! Well, maybe not so new anymore as I have been here for 3 months. After returning from travelling I soon realised that I needed a fresh start at a new company to really get me excited about programming again. After deciding it was time to move on one company instantly sprang to mind as the sort of place I&#8217;d love to work&#8230; <a href="http://specialmoves.com/">Specialmoves</a>. Having worked with them on a Lynx project whilst at <a href="http://tmw.co.uk/">TMW</a> I knew a few people at the company and thought I&#8217;d send my CV over and much to my delight &#8211; I got the job!</p>
<p>Specialmoves is very different to my previous jobs. The company is a studio rather than agency with little over 20 employees, and focuses primary on development. In my first week we had a Studio meeting and Darrell (one of the founders of the company) said that 10 years ago him and Pascal (you guessed it, the other founder) set the company up because they wanted to do <i>&#8220;cool sh*t&#8221;</i>, and it&#8217;s safe to say that is pretty much still the inspiration for all things Specialmoves. It&#8217;s an exciting place to work and the company are always trying to push the boundaries and be innovative. I hope to learn a lot working here.</p>
<p>Check out the video below for something I made in my first couple of weeks at Specialmoves. To read more about the project <a href="http://specialmoves.com/our-work/smirnoff.php">click here</a>.</p>
<p><iframe src="http://player.vimeo.com/video/26964891?title=0&amp;byline=0&amp;portrait=0&amp;color=772124" width="600" height="338" frameborder="0"></iframe></p>
<p>The other great thing about my new job is that it&#8217;s an Interactive Developer role, so not Flash/Actionscript specific. I like programming with Flash, it&#8217;s where I started out as a developer and I think AS3 is a fun language to write in. However, I&#8217;ve always believed as a developer it&#8217;s important not to get tied down to technologies and to remain open minded and keep learning/experimenting with new stuff. My role at Specialmoves will involve a lot of Flash, especially at the start, but I will also get an opportunity to work on other platforms like JavaScript and mobile development etc.</p>
<p>In other news my HTML5 version of ColorWall was recently added to the Chrome Experiments site. Check it out <a href="http://www.chromeexperiments.com/detail/colorwall/?f=">here</a> and give it a 5 star rating! <img src='http://www.flashmonkey.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I plan to re-ignite the website over the next few months so expect some more blog posts soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/its-all-gone-quiet-over-there/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML5 Snake</title>
		<link>http://www.flashmonkey.co.uk/html5-snake/</link>
		<comments>http://www.flashmonkey.co.uk/html5-snake/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 20:17:49 +0000</pubDate>
		<dc:creator>FlashMonkey</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.flashmonkey.co.uk/?p=1138</guid>
		<description><![CDATA[This is something I made this morning. I wanted to see if I could make a simple game in a couple of hours and I use to love playing snake on my old Nokia back when I was at school &#8230; <a href="http://www.flashmonkey.co.uk/html5-snake/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This is something I made this morning. I wanted to see if I could make a simple game in a couple of hours and I use to love playing snake on my old Nokia back when I was at school (yep mobile phones where invented before I left school &#8211; I&#8217;m not that old!!). Originally I was going to make it in Flash but a simple game like this is perfect for canvas and it&#8217;s an example of using the right technology for the job, rather than just sticking to something you know well.</p>
<p>Click <a onclick="pageTracker._trackEvent('Internal Link', 'Click', 'http://flashmonkey.co.uk/html5/snake/');" href="http://flashmonkey.co.uk/html5/snake/" target="_blank">here</a> to play and see if you can beat my high score of <b>44</b>. I&#8217;ll probably update it with a scoreboard soon. Oh and don&#8217;t try and run it in IE as it won&#8217;t work (no canvas support).</p>
<p><a onclick="pageTracker._trackEvent('Internal Link', 'Click', 'http://flashmonkey.co.uk/html5/snake/');" href="http://flashmonkey.co.uk/html5/snake/" target="_blank"><img src="http://flashmonkey.co.uk/html5/snake/nokia.jpg"></a></p>
<p>PS. It probably won&#8217;t work on your Nokia either but a mobile version could be an option in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flashmonkey.co.uk/html5-snake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

