<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PurpleFloyd's Blog</title>
	<atom:link href="http://purplefloyd.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://purplefloyd.wordpress.com</link>
	<description>Life, the Universe, and the Internet</description>
	<lastBuildDate>Fri, 02 Oct 2009 23:47:05 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='purplefloyd.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1167e34aba2575cd1e6eda5958bacf33?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>PurpleFloyd's Blog</title>
		<link>http://purplefloyd.wordpress.com</link>
	</image>
			<item>
		<title>A Platform Game Using HTML5 Canvas</title>
		<link>http://purplefloyd.wordpress.com/2009/09/11/a-platform-game-written-in-html5/</link>
		<comments>http://purplefloyd.wordpress.com/2009/09/11/a-platform-game-written-in-html5/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 18:34:02 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[video games]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=278</guid>
		<description><![CDATA[Nearly 15 years ago, when I was all of 15 years old, I wrote this little platform game which I have recently ported to Javascript/HTML5.  It is a kind of Mario clone and at the time I named it &#8220;Fred Jones in Adventureland&#8221;&#8230; hmm, not a great name.
It was a fun game to write and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=278&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.watersheep.org/~markh/html_canvas/game.html"><img class="alignright size-medium wp-image-285" title="Click to Play" src="http://purplefloyd.files.wordpress.com/2009/09/fj-screen3.png?w=300&#038;h=225" alt="screenshot" width="300" height="225" /></a>Nearly 15 years ago, when I was all of 15 years old, I wrote this little platform game which I have recently ported to Javascript/HTML5.  It is a kind of Mario clone and at the time I named it &#8220;Fred Jones in Adventureland&#8221;&#8230; hmm, not a great name.</p>
<p>It was a fun game to write and I learned a lot about game development and even game design in the process of writing it, some of which I occasionally put in to practice in my current job.</p>
<p>The game remains somewhat incomplete; the player has unlimited lives and unfortunately there are only 5 levels.  But as it stands it is a playable game and hopefully a little bit of fun.  There are a couple of small surprises in the levels along the way too.</p>
<h2>Browser Issues</h2>
<p>If you&#8217;re using <em>Microsoft Internet Explorer</em> 7.0 or higher the game will run awfully slow (<strong>Update: </strong>The game now supports the <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a> plug-in.  If you are using Internet Explorer you should install this plug-in, otherwise the game will run slowly).</p>
<p>It also will not run at all in earlier versions of Internet Explorer, Firefox 1.0 and I believe Opera 9 and earlier.  This is because these browsers do not support for the necessary parts of the HTML5 specification.  Please upgrade your browser.</p>
<h2>Controls</h2>
<p>Left Arrow: move left<br />
Right Arrow: move right<br />
Ctrl: jump</p>
<p style="text-align:center;"><a href="http://www.watersheep.org/~markh/html_canvas/game.html"><span style="font-size:x-large;"><strong>Play!</strong></span></a></p>
<p style="text-align:center;">Click the link above to play the game.</p>
<h2>Technical Details</h2>
<p>The game you are playing here is a <a href="http://en.wikipedia.org/wiki/Computer_port_%28software%29" target="_blank">port</a> of the original game to <a href="http://en.wikipedia.org/wiki/Html5" target="_blank">HTML5</a>/Javascript.  This means it now runs within any web modern browser.</p>
<p>Unlike most web games <strong><em>the game does not use Flash</em></strong>.  The &lt;canvas&gt; HTML5 element is used to draw all the visual elements.</p>
<p>All the code for the game is all available to read if you hit &#8220;view source&#8221; in your browser and I invite you to take a look.</p>
<p>I was pleasantly surprised by the performance of the &lt;canvas&gt; drawing operations and the modern javascript implementations, it runs at the same framerate it always has on pretty much all browsers except Internet Explorer.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=278&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/09/11/a-platform-game-written-in-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2009/09/fj-screen3.png?w=300" medium="image">
			<media:title type="html">Click to Play</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Users Slowest to Update Firefox</title>
		<link>http://purplefloyd.wordpress.com/2009/07/09/linux-users-slowest-to-update-firefox/</link>
		<comments>http://purplefloyd.wordpress.com/2009/07/09/linux-users-slowest-to-update-firefox/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 17:36:57 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mozilla Ubiquity]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=265</guid>
		<description><![CDATA[My screengrab script for Mozilla Labs Ubiquity (think of Ubiquity as an extensible command-line interface for Firefox&#8230; if you can imagine that) gets fairly regular hits.  Depending on the user&#8217;s preference, each time they start Firefox a request will be made to my site to check for any newer version of the script.
This means that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=265&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My <a href="/screengrab-ubiquity-script/">screengrab script</a> for <a href="http://labs.mozilla.com/projects/ubiquity/" target="_blank">Mozilla Labs Ubiquity</a> (think of Ubiquity as an extensible command-line interface for Firefox&#8230; if you can imagine that) gets fairly regular hits.  Depending on the user&#8217;s preference, each time they start Firefox a request will be made to my site to check for any newer version of the script.</p>
<p>This means that for some users I get a web server log message every time they start their browser.</p>
<p>One interesting statistic I&#8217;ve uncovered from these logs is a startling lack of hits from Firefox 3.5 on Linux systems.  It seems that almost no one running Linux has bothered to upgrade to the shiny, if not a little over-hyped, latest offering from the Mozilla team.</p>
<p>These ugly charts show the picture somewhat better than words can.  (Can anyone recommend a prettier, free charting tool?).</p>
<p><a href="http://purplefloyd.files.wordpress.com/2009/07/linuxff35adoption1.png"><img class="alignnone size-full wp-image-271" title="LinuxFF35Adoption" src="http://purplefloyd.files.wordpress.com/2009/07/linuxff35adoption1.png?w=469&#038;h=322" alt="LinuxFF35Adoption" width="469" height="322" /></a></p>
<p><a href="http://purplefloyd.files.wordpress.com/2009/07/windowsff35adoption1.png"><img class="alignnone size-full wp-image-273" title="WindowsFF35Adoption" src="http://purplefloyd.files.wordpress.com/2009/07/windowsff35adoption1.png?w=469&#038;h=322" alt="WindowsFF35Adoption" width="469" height="322" /></a></p>
<p><a href="http://purplefloyd.files.wordpress.com/2009/07/macff35adoption1.png"><img class="alignnone size-full wp-image-272" title="MacFF35Adoption" src="http://purplefloyd.files.wordpress.com/2009/07/macff35adoption1.png?w=469&#038;h=322" alt="MacFF35Adoption" width="469" height="322" /></a></p>
<p>As the pies show, only 4% of the 70 Linux users to hit my site in the last 5 days have upgraded to Firefox 3.5.  Compare that with the 76% and 56% of Windows and Mac users respectively and you cannot deny the conclusion that Linux users are slow adopters.</p>
<p>Of course the reason behind the slow adoption is obvious: the ever so slightly Orwellian package maintainers.  Ubuntu (which comprises 58 of my 70 Linux visitors) only makes Firefox 3.5 available in development repositories, not the main-line.  It&#8217;ll be the default browser come Karmic Koala, but do we really all have to wait until October for a faster Javascript engine and what not?</p>
<p>There are more ways to get Firefox 3.5 into your Linux distro than I care to name or describe.  But all of these either find ways around your package manager or use untrusted 3rd-party repositories.</p>
<p>So for the sake of keeping your system stable, the pragmatic thing to do on the Linux desktop is to wait until your distro decides to support the software you want to use.  <em>That is hardly putting the user in control.</em></p>
<p>There has to be a better way.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=265&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/07/09/linux-users-slowest-to-update-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2009/07/linuxff35adoption1.png" medium="image">
			<media:title type="html">LinuxFF35Adoption</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2009/07/windowsff35adoption1.png" medium="image">
			<media:title type="html">WindowsFF35Adoption</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2009/07/macff35adoption1.png" medium="image">
			<media:title type="html">MacFF35Adoption</media:title>
		</media:content>
	</item>
		<item>
		<title>I&#8217;m on BBC News!</title>
		<link>http://purplefloyd.wordpress.com/2009/03/26/im-on-bbc-news/</link>
		<comments>http://purplefloyd.wordpress.com/2009/03/26/im-on-bbc-news/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 10:21:57 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=262</guid>
		<description><![CDATA[If you visit the BBC News Technology Homepage at the moment you&#8217;ll find a link to my Red Button Arcade blog post in the Features, Views and Analysis section.  Must have been a slow news day&#8230;

Woop!
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=262&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If you visit the <a href="http://news.bbc.co.uk/1/hi/technology/default.stm">BBC News Technology Homepage</a> at the moment you&#8217;ll find a link to my <a href="http://www.bbc.co.uk/blogs/pressred/2009/03/redbuttonarcade.shtml">Red Button Arcade blog post</a> in the Features, Views and Analysis section.  Must have been a slow news day&#8230;</p>
<p><a href="http://purplefloyd.files.wordpress.com/2009/03/bbcnewstechfeatures.png"><img class="size-full wp-image-263 alignnone" title="BBC News snippet" src="http://purplefloyd.files.wordpress.com/2009/03/bbcnewstechfeatures.png?w=466&#038;h=324" alt="BBC News snippet" width="466" height="324" /></a></p>
<p>Woop!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/262/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=262&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/03/26/im-on-bbc-news/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2009/03/bbcnewstechfeatures.png" medium="image">
			<media:title type="html">BBC News snippet</media:title>
		</media:content>
	</item>
		<item>
		<title>My BBC Red Button games blog post is up&#8230;</title>
		<link>http://purplefloyd.wordpress.com/2009/03/23/my-bbc-red-button-games-blog-post-is-up/</link>
		<comments>http://purplefloyd.wordpress.com/2009/03/23/my-bbc-red-button-games-blog-post-is-up/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 10:32:56 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[BBC]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[MHEG]]></category>
		<category><![CDATA[freeview]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[interactive tv]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=257</guid>
		<description><![CDATA[My BBC Red Button Aracde blog post is live on the BBC Red Button blog.  Follow the link to read about the challenges of writing simple games on interactive television platforms.
The post includes a video and screenshots of the games I&#8217;ve written during my &#8220;10% time&#8221; at the BBC.  This is time we are given — [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=257&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My <a href="http://www.bbc.co.uk/blogs/pressred/2009/03/redbuttonarcade.shtml">BBC Red Button Aracde blog post</a> is live on the BBC Red Button blog.  Follow the link to read about the challenges of writing simple games on interactive television platforms.</p>
<p>The post includes a video and screenshots of the games I&#8217;ve written during my &#8220;10% time&#8221; at the BBC.  This is time we are given — half a day each week — to work on our own projects and try to innovate.</p>
<p>The games are written in the MHEG programming language, a subject <a href="/tag/mheg/">I often discuss on this blog</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/257/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=257&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/03/23/my-bbc-red-button-games-blog-post-is-up/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>
	</item>
		<item>
		<title>I get a mention on the BBCi blog</title>
		<link>http://purplefloyd.wordpress.com/2009/02/23/i-get-a-mention-on-the-bbci-blog/</link>
		<comments>http://purplefloyd.wordpress.com/2009/02/23/i-get-a-mention-on-the-bbci-blog/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 10:37:38 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[BBC]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[MHEG]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=252</guid>
		<description><![CDATA[Today&#8217;s post on the BBCi Labs blog briefly mentions  a Pong game I wrote for Freeview/Freesat set-top boxes a while ago.  A couple of the guys in the BBCi team took my game and tried to make it multiplayer by passing players&#8217; movements over the internet.  I don&#8217;t think they were totally sucessful though in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=252&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today&#8217;s post on the BBCi Labs blog briefly mentions  a Pong game I wrote for Freeview/Freesat set-top boxes a while ago.  A couple of the guys in the BBCi team took my game and tried to make it multiplayer by passing players&#8217; movements over the internet.  I don&#8217;t think they were totally sucessful though in getting it to work though&#8230;</p>
<p>Here&#8217;s the <a href="http://www.bbc.co.uk/blogs/bbcilabs/2009/02/onebigday.html">link</a>.  The &#8216;Pong challenge&#8217; section is the where it&#8217;s at&#8230;</p>
<p>Also see <a href="/2008/09/19/video-games-ive-written-in-mheg/">here</a> for a video of the Pong game (the single player version), it&#8217;s the third game shown in the video.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/252/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=252&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/02/23/i-get-a-mention-on-the-bbci-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>
	</item>
		<item>
		<title>Signing .deb packages</title>
		<link>http://purplefloyd.wordpress.com/2009/02/05/signing-deb-packages/</link>
		<comments>http://purplefloyd.wordpress.com/2009/02/05/signing-deb-packages/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 15:00:41 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dpkg]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=230</guid>
		<description><![CDATA[Okay, so here&#8217;s the scenario: you distribute .deb packages without an apt repository, but want to start signing your packages to ensure they aren&#8217;t corrupted or tampered with during transit to your users. I say &#8220;without an apt repository&#8221; since apt has its own mechanism for signing whole releases, via SecureApt.
The tools you are expected [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=230&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Okay, so here&#8217;s the scenario: you distribute .deb packages without an apt repository, but want to start signing your packages to ensure they aren&#8217;t corrupted or tampered with during transit to your users. I say &#8220;without an apt repository&#8221; since apt has its own mechanism for signing whole releases, via <a href="http://wiki.debian.org/SecureApt">SecureApt</a>.</p>
<p>The tools you are expected to use for this purpose are <tt>debsign</tt> and <tt>debsign-verify</tt>.  Unfortunately I found the documentation for these to be pretty thin and ended up having to read the source of <tt>debsig-verify</tt> to work out what was expected of a signed package.</p>
<p>So hopefully to prevent others from having to trawl through source code, below are steps you could follow to sign your own .deb packages.  My method is somewhat contra to the prescribed method from Debian, however it is the only way I&#8217;ve managed to get working.  Please suggest better methods if you know them.</p>
<p>The steps I performed were:</p>
<ol>
<li>Create your GPG signing key, run<br />
<strong> </strong></p>
<pre><strong>$ gpg --gen-key</strong></pre>
<p><strong></strong><br />
and follow the steps. <span id="more-230"></span></li>
<li>Sign the .deb with your private key, without using debsign (please comment if you get debsign to work for you, I couldn&#8217;t&#8230;).
<ol>
<li>Take an existing .deb and unpack it:<br />
<strong> </strong></p>
<pre><strong>$ ar x my_package_1_0_0.deb</strong></pre>
<p><strong></strong></li>
<li>Concatenate its contents (the order is important), and output to a temp file:<br />
<strong> </strong></p>
<pre><strong>$ cat debian-binary control.tar.gz data.tar.gz &gt; /tmp/combined-contents</strong></pre>
<p><strong></strong></li>
<li>Create a GPG signature of the concatenated file, calling it <tt>_gpgorigin</tt>:<br />
<strong> </strong></p>
<pre><strong>$ gpg -abs -o _gpgorigin /tmp/combined-contents</strong></pre>
<p><strong></strong></li>
<li>Finally, bundle the .deb up again, including the signature file:<br />
<strong> </strong></p>
<pre><strong>$ ar rc my_package_1_0_0.deb _gpgorigin debian-binary control.tar.gz data.tar.gz</strong></pre>
<p><strong></strong></li>
</ol>
</li>
<li>Export your signing public key and determine its key id.
<ol>
<li>Export your public key:<br />
<strong> </strong></p>
<pre><strong>$ gpg --export -a &gt; my-debsig.asc</strong></pre>
<p><strong></strong></li>
<li>Extract the key id by taking the last 4 chunks of the fingerprint, <tt>CA58BC6A0695623E</tt> in this case.  We always use it without the spaces:<br />
<strong> </strong></p>
<pre><strong>$ gpg --fingerprint
/home/floyd/.gnupg/pubring.gpg
------------------------------
pub   1024D/0695623E 2009-02-04
      Key fingerprint = 6577 AAB2 8850 9E0B 1059  C510 CA58 BC6A 0695 623E
uid                  Purple (Floyd) &lt;--your email address--&gt;
sub   2048g/EB122979 2009-02-04</strong></pre>
<p><strong></strong></li>
</ol>
</li>
<li>Setup the machine(s) that will be downloading and verifying the package.
<ol>
<li>Install the debsig-verify package<br />
<strong> </strong></p>
<pre><strong>$ apt-get install debsig-verify</strong></pre>
<p><strong></strong></li>
<li>Import the public key into the debsig keyring:<br />
<strong> </strong></p>
<pre><strong>$ mkdir /usr/share/debsig/keyrings/[key_id]
$ gpg --no-default-keyring --keyring /usr/share/debsig/keyrings/[key_id]/debsig.gpg \
      --import my-debsig.asc</strong></pre>
<p><strong></strong></li>
<li>Configure a policy for the key, policies are discussed in some detail in <tt>/usr/share/doc/debsig-verify</tt>.  The policy file needs to be kept in <tt>/etc/debsig/policies/[key_id]/[policy_name].pol</tt>.  Mine looks like this:<br />
<strong> </strong></p>
<pre><strong>&lt;?xml version="1.0"?&gt;
&lt;!DOCTYPE Policy SYSTEM "http://www.debian.org/debsig/1.0/policy.dtd"&gt;
&lt;Policy xmlns="http://www.debian.org/debsig/1.0/"&gt;

  &lt;Origin Name="PurpleFloyd" id="CA58BC6A0695623E"
          Description="Another package from PurpleFloyd"/&gt;

  &lt;Selection&gt;
    &lt;Required Type="origin" File="debsig.gpg" id="CA58BC6A0695623E"/&gt;
  &lt;/Selection&gt;

  &lt;Verification MinOptional="0"&gt;
    &lt;Required Type="origin" File="debsig.gpg" id="CA58BC6A0695623E"/&gt;
  &lt;/Verification&gt;

&lt;/Policy&gt;</strong></pre>
<p><strong></strong></li>
</ol>
</li>
<li>You should now be able to verify the package using <tt>debsig-verify</tt>, i.e.:<br />
<strong> </strong></p>
<pre><strong>$ debsig-verify my_package_1_0_0.deb
debsig: Verified package from `PurpleFloyd' (Another package from PurpleFloyd)</strong></pre>
<p><strong></strong></li>
</ol>
<p>Et voila!  You have signed and verified a debian package.</p>
<p><strong>Note: </strong>on most distros, dpkg/apt will not check the signature of a package when installing it, even if a signature is present.  This checking can be enabled by removing the <tt>--no-debsig</tt> line from <tt>/etc/dpkg/dpkg.cfg</tt>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/230/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=230&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/02/05/signing-deb-packages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>
	</item>
		<item>
		<title>MHEG+ Game Development Tutorial, Part #2 &#8212; Animation</title>
		<link>http://purplefloyd.wordpress.com/2008/12/14/mheg-game-development-tutorial-part-2-animation/</link>
		<comments>http://purplefloyd.wordpress.com/2008/12/14/mheg-game-development-tutorial-part-2-animation/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 17:41:50 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[BBC]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[MHEG]]></category>
		<category><![CDATA[freesat]]></category>
		<category><![CDATA[freeview]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[interactive tv]]></category>
		<category><![CDATA[MHEGPLUS]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=123</guid>
		<description><![CDATA[In part #1 of this series we built a basic MHEG+ scene which was capable of firing timer events at a consistent rate.  In this part we will look to extend the code by adding an animating graphic to the scene.
A further aim of this part is to explain some more of the language features [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=123&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In <a href="http://purplefloyd.wordpress.com/2008/11/26/mheg-game-development-tutorial-part-1-timing/" target="_self">part #1</a> of this series we built a basic MHEG+ scene which was capable of firing timer events at a consistent rate.  In this part we will look to extend the code by adding an animating graphic to the scene.</p>
<p>A further aim of this part is to explain some more of the language features exclusive to MHEG+, including <tt>foreach</tt> loops, <tt>sequential</tt> blocks and <tt>if</tt>s.</p>
<h3>Adding our graphics to the scene</h3>
<p>I have hand crafted the following 5 png graphics to use for this tutorial:</p>
<p><img class="alignnone size-full wp-image-127" title="pacs" src="http://purplefloyd.files.wordpress.com/2008/12/pacs.png?w=480&#038;h=93" alt="pacs" width="480" height="93" /></p>
<p>Using an MHEG+ <tt>foreach</tt> loop, we can add all these graphics to our scene in one fell swoop:</p>
<pre>  foreach num (0..4) {
    {:Bitmap bmpPac&lt;num&gt; = [constPacObjectIdOffset + &lt;num&gt;]
     :OrigPosition          [(720 - 32) / 2] [(576 - 32) / 2]
     :OrigBoxSize           32 32
     :OrigContent           :ContentRef ('/tut/&lt;num&gt;.png')
     :InitiallyActive       false
    }
  } endfor</pre>
<p>There a number of subtleties of this loop which are probably worth discussing:-</p>
<ul>
<li><tt>foreach</tt> loops are preprocessor instructions, not run-time loops.  Because of this we can use foreach loops around object declarations, or in fact any code section at all.</li>
<li>In this case, the contents of the foreach loop will be duplicated 5 times, this is controlled by the <tt>(0..4)</tt> range on the first line.  This range need not be numeric, text may also be used, for example: <tt>foreach key (red, green, yellow, blue)</tt> is allowed.</li>
<li>The <tt>Bitmap</tt>s we declare will be named <tt>bmpPac0</tt> through <tt>bmpPac4</tt>, <tt>&lt;num&gt;</tt> is substituted with each value in the range.</li>
<li>The <em>object identifiers</em> for the Bitmaps will be 100 through 104, assuming <tt>constPacObjectIdOffset</tt> has the value 100.  We use the MHEG+ notation: <em>objectname = objectid</em> to declare both names and object identifiers for our Bitmaps.</li>
<li><tt>&lt;num&gt;</tt> is also substituted in the png filename</li>
</ul>
<p><span id="more-123"></span>You may also have noticed that our 5 Bitmaps have <tt>:InitiallyActive</tt> set to false.  We will later call <tt>:Run</tt> and <tt>:Stop</tt> on our Bitmaps to control which frame of the animation is visible, so they do not need to be <em>running</em> at startup.  However we do still want to pre-load our Bitmaps when the scene loads in order to have them prepared in memory and ready to use, so we add the following to <tt>lnkStartup</tt>:</p>
<pre>  // preload graphics
  foreach num (0..4) {
    bmpPac&lt;num&gt;.Preload()
  } endfor</pre>
<p>Here we are using a foreach loop not for ingredient declaration but to duplicate a line of code in a link effect.  Again, <tt>&lt;num&gt;</tt> is substituted appropriately.</p>
<h3>Drawing each frame</h3>
<p>As in part #1 of this series, we will use the Link <tt>lnkGameTick</tt> to calculate and render each frame of our game.  The first thing we did in <tt>lnkGameTick</tt> is set the next timer event, this is to ensure our game runs at a fairly consistent pace.</p>
<p>We now extend <tt>lnkGameTick</tt> to call out to two <tt>sequential</tt>s.  The first sequential &#8220;calculates&#8221; the next game tick, the second renders it to the screen.  We therefore add the following to <tt>lnkGameTick</tt>:</p>
<pre>  tgPac.CallActionSlot(calculateNextFrame)
  :LockScreen()
  tgPac.CallActionSlot(updateScreen)
  :UnlockScreen()</pre>
<p><em>(Note: Games often separate the concerns of calculating a frame from rendering it.  In an environment other than MHEG this could allow us to choose whether to render the current frame (which is normally an expensive operation) to keep the game tick rate consistent.  MHEG however without precision timing does not allow us this freedom, but separating along these lines makes our code more maintainable.)</em></p>
<p>Note that we call <tt>:LockScreen</tt> and <tt>:UnlockScreen</tt> around the call to <tt>updateScreen</tt>.  This effectively tells the MHEG engine to render our new frame off-screen and display the changes only when we call unlock.  This is akin to <a href="http://en.wikipedia.org/wiki/Double_buffering#Double_Buffering_in_Computer_Graphics">Double Buffering</a> and helps reduce screen flicker.</p>
<p>We still need to implement the sequentials <tt>calculateNextFrame</tt> and <tt>updateScreen</tt>, which I&#8217;ll describe in the next two sections.</p>
<h4>Calculating what to display</h4>
<p>For each game tick we need to determine what should be visible on the screen.  In the case of our animation of the &#8216;Pac&#8217; character, this means determining which of our 5 Bitmap ingredients should be visible.</p>
<p>So the effect of the <tt>calculateNextFrame</tt> macro should be to modify an integer variable whose value will later be used to identify the Bitmap to display.  We&#8217;ll call this integer <tt>intNextPacObjectId</tt>.</p>
<p>Here is the necessary code:</p>
<pre>  defSequential calculateNextFrame :Namespace tgPac {
  (
    // increment counter
    intCount.Add(1)
    intCount.Modulo(constNumFrames)

    // calculate object Id of Pac Bitmap to display this frame
    intNextPacObjectId.SetVariable(:IndirectRef intCount)
    :If (intNextPacObjectId &gt;= constNumBitmaps) {
      intNextPacObjectId.SetVariable(constNumFrames)
      intNextPacObjectId.Subtract(:IndirectRef intCount)
    }
    intNextPacObjectId.Add(constPacObjectIdOffset)
  )
  } endSequential</pre>
<p>Of note in this code section:-</p>
<ul>
<li>The sequential declaration states which namespace it belongs to.  When we call a sequential we use the notation: <em>namespace dot CallActionSlot( sequential )</em>, as we do in <tt>lnkGameTick</tt>.<br />
In MHEG+ we also must declare the <tt>tgPac</tt> token group and call <tt>:InsertSequentials</tt>, see the complete code listing below for example code.  An MHEG+ sequential is a façade to an MHEG <tt>ActionSlot</tt>.  Sequentials though can be declared anywhere in the source file and have cleaner syntax.</li>
<li>Did you notice the <tt>:If</tt>?  MHEG+ gives us the syntatic sugar of being able to declare inline If blocks.  In classic MHEG our only way of implementing conditional code sections was to use the <tt>:TestVariable</tt> action and write separate <tt>:Link</tt>s to perform actions based on the evaluation of the test.  In fact this is what MHEG+ does behind the scenes, but the abstraction is very handy.  We can also write <tt>:Else</tt> and <tt>:ElseIf</tt> blocks.</li>
</ul>
<h4>Updating the screen</h4>
<p>Now that we have calculated the object Id of the Bitmap to display and stored this in an integer, we need to write a sequential to hide the current Bitmap that is displayed and show the new one.</p>
<p>Only by a call to a resident program can we translate an integer value into a reference to an actual object, the resident program to do this is called <tt>CastToObjectReference</tt>, or CTO.</p>
<p>Here is our implementation of this sequential:</p>
<pre>  defSequential updateScreen :Namespace tgPac {
  (
    // stop the bitmap of previous frame
    :Stop(:IndirectRef objPac)
    prgCastToObjectRef.Call(boolTemp
        "/tut/tut2.mhg" :IndirectRef intNextPacObjectId
        :IndirectRef objPac)
    // run the bitmap of this frame
    :Run(:IndirectRef objPac)
  )
  } endSequential</pre>
<ul>
<li>We call the <tt>prgCastToObjectRef</tt> resident program in order to retrieve a handle to an object given its object Id.  We pass an integer (which will be in the range 100 to 104) and dynamically gain access to the object with this identifier.  This is why we explicitly stated the our Bitmaps&#8217; object Ids when we declared them.</li>
<li>Note that we can&#8217;t use <em>object dot action</em> notation when dealing with object references (objPac is an object reference variable), this is a limitation of MHEG+.  This we must write <tt>:Run(:IndirectRef objPac)</tt> and not <tt>objPac.Run()</tt>.</li>
</ul>
<h3>Putting it all together</h3>
<p>Hopefully it should be fairly clear by now what the scene does.  At the middle of the screen we see the following animation:</p>
<p style="text-align:center;"><img class="size-full wp-image-132 aligncenter" title="pacanim" src="http://purplefloyd.files.wordpress.com/2008/12/pacanim.gif?w=32&#038;h=32" alt="pacanim" width="32" height="32" /></p>
<p>Because we have used <tt>:LockScreen</tt>s and tried to keep the work done whilst the screen is locked to a minimum, the animation will be fast and practically flicker free.</p>
<p>Looking at the complete listing (see Resources section below) it would be true to say that MHEG+ is not the cleanest of programming languages.  However it is a lot more readable and maintainable than traditional MHEG.</p>
<p>The source listing really boils down to two key sequentials: <tt>calculateNextFrame</tt> and <tt>updateScreen</tt>.  We would be wise to move each of these sequentials into separate files and develop them somewhat independently of eachother and the rest of the scene.  MHEG+ allows us to use <tt>import</tt> declarations in order to better manage our source code.</p>
<h3>Where to from here?</h3>
<p>This is a good starting point for a game.  Of course there is still plenty to do, including:-</p>
<ul>
<li>Moving the sprite around the screen</li>
<li>Rotating the sprite when it changes direction</li>
<li>Adding a maze</li>
<li>Adding other objects to the maze</li>
</ul>
<p>There are also a number of  MHEG+ features we have yet to use including <tt>macro</tt>s (both parameterised and not), <tt>state machines</tt> and <tt>import</tt>s.</p>
<p>In later posts I hope to explore these themes and also discuss the tools that make up the MHEG+ SDK including the MHEG Player (emulator), MHEG+ compiler and the Eclipse editor plug-in.</p>
<h3>Resources</h3>
<p>Complete source listing as a PDF: <a href="http://purplefloyd.files.wordpress.com/2008/12/tut21.pdf">tut2.pdf</a>.</p>
<p>Animation graphics (0.png through 4.png):</p>
<p><a href="http://purplefloyd.files.wordpress.com/2008/12/0.png"><img class="alignleft size-full wp-image-195" title="0.png" src="http://purplefloyd.files.wordpress.com/2008/12/0.png?w=32&#038;h=32" alt="0.png" width="32" height="32" /></a></p>
<p><a href="http://purplefloyd.files.wordpress.com/2008/12/1.png"><img class="alignleft size-full wp-image-196" title="1.png" src="http://purplefloyd.files.wordpress.com/2008/12/1.png?w=32&#038;h=32" alt="1.png" width="32" height="32" /></a><a href="http://purplefloyd.files.wordpress.com/2008/12/2.png"><img class="alignleft size-full wp-image-197" title="2.png" src="http://purplefloyd.files.wordpress.com/2008/12/2.png?w=32&#038;h=32" alt="2.png" width="32" height="32" /></a><a href="http://purplefloyd.files.wordpress.com/2008/12/3.png"><img class="alignleft size-full wp-image-198" title="3.png" src="http://purplefloyd.files.wordpress.com/2008/12/3.png?w=32&#038;h=32" alt="3.png" width="32" height="32" /></a><a href="http://purplefloyd.files.wordpress.com/2008/12/4.png"><img class="size-full wp-image-194 alignnone" title="4.png" src="http://purplefloyd.files.wordpress.com/2008/12/4.png?w=32&#038;h=32" alt="4.png" width="32" height="32" /></a></p>
<p>Other posts in this series:<br />
<a href="http://purplefloyd.wordpress.com/2008/11/26/mheg-game-development-tutorial-part-1-timing/">Part #1 — Timing</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=123&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2008/12/14/mheg-game-development-tutorial-part-2-animation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/12/pacs.png" medium="image">
			<media:title type="html">pacs</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/12/pacanim.gif" medium="image">
			<media:title type="html">pacanim</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/12/0.png" medium="image">
			<media:title type="html">0.png</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/12/1.png" medium="image">
			<media:title type="html">1.png</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/12/2.png" medium="image">
			<media:title type="html">2.png</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/12/3.png" medium="image">
			<media:title type="html">3.png</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/12/4.png" medium="image">
			<media:title type="html">4.png</media:title>
		</media:content>
	</item>
		<item>
		<title>MHEG+ Game Development Tutorial, Part #1 &#8212; Timing</title>
		<link>http://purplefloyd.wordpress.com/2008/11/26/mheg-game-development-tutorial-part-1-timing/</link>
		<comments>http://purplefloyd.wordpress.com/2008/11/26/mheg-game-development-tutorial-part-1-timing/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 23:55:21 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[BBC]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[MHEG]]></category>
		<category><![CDATA[freesat]]></category>
		<category><![CDATA[freeview]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[interactive tv]]></category>
		<category><![CDATA[MHEGPLUS]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=77</guid>
		<description><![CDATA[Introduction to this Series
One of the joys of my job at the BBC is staying back after hours and trying to nut out how best to write real-time games on current interactive television platforms.  That is, trying to write the kind of games that you might have once played in an arcade, or maybe on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=77&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h3>Introduction to this Series</h3>
<p>One of the joys of my job at the BBC is staying back after hours and trying to nut out how best to write real-time games on current interactive television platforms.  That is, trying to write the kind of games that you might have once played in an arcade, or maybe on your BBC Micro, but allowing you to play them via the &#8216;Red Button&#8217;.  See <a href="/2008/09/19/video-games-ive-written-in-mheg/" target="_self">this post</a> for a video of some of my efforts so far.</p>
<p>Here in these tutorials I hope to share with you some of my findings in trying to get the best out of the MHEG platform.  I also hope to demonstrate the power of the MHEG+ programming language, an extension to MHEG.  MHEG+ has been developed in-house at the BBC and compiles down to traditional MHEG/ASN, but is a far richer langauge than its predecessor.</p>
<p>For these tutorials I will assume you have some background in programming generally and hopefully some experience writing MHEG or interactive TV applications (MHP, OpenTV, etc.).  The code samples will all be in MHEG+ which at time of writing is not available outside the BBC, however efforts are being made to attempt to open source MHEG+ development tools, so watch this space&#8230;</p>
<p>I guess for the time being then you most likely won&#8217;t be able to compile or run these applications, but hopefully one day soon you will be able to.  Therefore I suppose the code herein is currently just for educational purposes, but then that is the point of the series <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>So, without further ado&#8230;</p>
<h3>Part #1: Timing</h3>
<p>The first significant challenge that I came across when writing MHEG games was that of timing.  How could I ensure my game would run at virtually the same speed on any set top box?</p>
<p>Unlike more sophisticated languages (yes, I openly admit that MHEG is not the most sophisticated language, but then it was never designed to be) MHEG does not provide the developer with a means of retrieving accurate clock information.  The most fine-grained time information you can retrieve (achieved by a call to the GetCurrentDate resident program) provides no better than whole second precision.<span id="more-77"></span></p>
<p>MHEG <tt>Timer</tt>s however provides us with some hope.  The <tt>:SetTimer</tt> action expects a millisecond count as an argument &#8211; hooray! we have precision timing.  Well, almost.</p>
<p>The UK MHEG profile goes into considerable detail about the accuracy of Timers which I won&#8217;t go into here except to say that they are accurate enough for most gaming needs.</p>
<p>The UK profile also states that the MHEG engine must start a timer immediately when a call to <tt>:SetTimer</tt> is encountered.  This we can use to our advantage.</p>
<p>Let&#8217;s try this out in some code, here is a simple MHEG scene with a timer.  It is written in MHEG+:</p>
<pre>{:Scene ("/tut/tut1.mhg" 0)
 :Items (
        // Constant declarations
        // ---------------------
        {:IntegerConst constTimerDelay :ConstValue 100}

        // Variables -----------
        // ---------------------
        {:IntegerVar intCount :OrigValue 0}
        {:OStringVar strTemp :OrigValue ''}

        // Ingredients ---------
        // ---------------------
        {:Text txtText
         :OrigContent           '0'
         :OrigPosition          0 [(576 - 100) / 2]
         :OrigBoxSize           720 100
         :HJustification        centre
         :VJustification        centre
        }

        {:Timer tmrTimer}

        // Links ---------------
        // ---------------------
        {:Link lnkStartup
         :EventSource           0
         :EventType             IsRunning
         :LinkEffect
         (
                :SetTimer(0 tmrTimer constTimerDelay)
         )
        }

        {:Link lnkGameTick
         :EventSource           0
         :EventType             TimerFired
         :EventData             tmrTimer
         :LinkEffect
         (
                :SetTimer(0 tmrTimer constTimerDelay)

                intCount.Add(1)
                strTemp.SetVariable(:IndirectRef intCount)
                txtText.SetData(:IndirectRef strTemp)
         )
        }

        {:Link lnkKeyText
         :EventSource           0
         :EventType             UserInput
         :EventData             KeyText
         :LinkEffect    ( :Quit() )
        }
 )

 :InputEventReg 4
 :SceneCS 720 576
}</pre>
<p>The key elements of the scene are its <tt>:Link</tt>s.  Links are where most processing happens in MHEG applications.  MHEG links could have been called &#8220;action listeners&#8221;.  You write links to listen for particular events, when this event occours your procedural code in the <tt>:LinkEffect</tt> section is executed by the MHEG engine.</p>
<p>The links defined in the scene are:-</p>
<ul>
<li><tt>lnkGameTick</tt> — this link is fired whenever the timer times out.  Its effect is to increment our integer counter variable, convert it to a string (storing in <tt>strTemp</tt>) and update the display (<tt>txtText</tt>).  The very first thing we do in the link effect however is <em>set the next timer event</em>.</li>
<li><tt>lnkStartup</tt> — this link is called after our scene has finished loading.  It is important because this is where we set up the first timer event.  Timers cannot be set to fire automatically when the scene loads.</li>
<li><tt>lnkKeyText</tt> — this link listens for a key press, specifically the Text button on your remote control.  Its effect is to simply exit the application (it calls <tt>:Quit</tt>).</li>
</ul>
<p>Other things of note in the code:-</p>
<ul>
<li>MHEG+ allows us to use names for our objects, conversely classic MHEG requires that all objects be identified solely by a number.</li>
<li>The actions in <tt>lnkGameTick</tt> are using MHEG+ dot notation (object dot action).</li>
<li>The vertical position of the <tt>txtText</tt> Text object is written as an expression (<tt>[(576 - 100) / 2]</tt>), this is an MHEG+ feature, the expression is evaluated at compile time.</li>
<li>We declare a constant (<tt>constTimerDelay</tt>) another MHEG+-only feature.</li>
<li><tt>:InputEventReg</tt> and <tt>:SceneCS</tt> at the bottom of the scene if you are wondering are indeed required.  Let&#8217;s not go into detail about these now though as they can be considered just boilerplate code in most cases.</li>
</ul>
<p>If you haven&#8217;t guessed by now, when its run the scene displays a counting number in the centre of the screen, which updates every 100ms.  Here is a cropped screenshot of the app after letting it run for approximately [100 * 103] milliseconds:-<br />
<a href="http://purplefloyd.files.wordpress.com/2008/11/tut12.png"><img class="alignnone size-full wp-image-104" title="tut1" src="http://purplefloyd.files.wordpress.com/2008/11/tut12.png?w=431&#038;h=60" alt="tut1" width="431" height="60" /></a></p>
<p>The key lesson to take from this is that we <strong>set the timer at the top of lnkGameTick</strong>. Why?  By doing so we are ensuring that the timer event will be fired at the most consistent rate possible in MHEG.  The timer can only ever be late.  We simply now have to make sure that our game loop is efficient enough to be executed within our specified time period (here, 100ms).</p>
<p>So that&#8217;s it for part #1 of my MHEG+ tutorial.  I hope that you got something out of it.  I would imagine the most useful content here was the code section — is this the first time you have seen MHEG+ code?</p>
<p>I hope later posts in the series will look into some of the more advanced features of MHEG+ such as <tt>If</tt> statements, <tt>For</tt> loops and <tt>Macros</tt>, plus I shall of course endeavour to include the complete source code for a number of simple, but playable, games.</p>
<p>Ciao for now.  Hope to be back soon.</p>
<h3>Resources</h3>
<p>Other posts in this series:<br />
<a href="http://purplefloyd.wordpress.com/2008/12/14/mheg-game-development-tutorial-part-2-animation/" target="_self">Part #2 — Animation</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/77/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/77/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/77/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=77&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2008/11/26/mheg-game-development-tutorial-part-1-timing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/11/tut12.png" medium="image">
			<media:title type="html">tut1</media:title>
		</media:content>
	</item>
		<item>
		<title>Screengrab Ubiquity Script</title>
		<link>http://purplefloyd.wordpress.com/2008/10/05/screengrab-ubiquity-script/</link>
		<comments>http://purplefloyd.wordpress.com/2008/10/05/screengrab-ubiquity-script/#comments</comments>
		<pubDate>Sun, 05 Oct 2008 18:37:21 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[firefox add-on]]></category>
		<category><![CDATA[screen capture]]></category>
		<category><![CDATA[screengrab]]></category>
		<category><![CDATA[screenshot tools]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[ubiquity script]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=59</guid>
		<description><![CDATA[Firefox users with the Ubiquity extension installed might like to try my Screengrab script which provides the commands:-

&#8217;screengrab&#8217; — saves the current browser window to the clipboard, and
&#8217;screengrab-to-file&#8217; — saves the current browser window to a png image file.

Once the screengrab command has been issued, the image can be simply pasted from the cilpboard into webmail [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=59&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.mozilla.com/firefox/" target="_blank">Firefox</a> users with the <a href="http://labs.mozilla.com/projects/ubiquity/" target="_blank">Ubiquity</a> extension installed might like to try my <em>Screengrab</em> script which provides the commands:-</p>
<ul>
<li>&#8217;screengrab&#8217; — saves the current browser window to the clipboard, and</li>
<li>&#8217;screengrab-to-file&#8217; — saves the current browser window to a png image file.</li>
</ul>
<p>Once the screengrab command has been issued, the image can be simply pasted from the cilpboard into webmail emails such as GMail.</p>
<p>I&#8217;d like to eventually extend the script to provide a &#8217;screengrab-and-email&#8217; command.</p>
<p><a href="http://www.watersheep.org/~markh/screengrab.html" target="_self">Downloads and more details here</a>.</p>
<p>Here&#8217;s a screenshot:<br />
<a href="http://purplefloyd.files.wordpress.com/2008/10/screengrab.png"><img class="alignnone size-medium wp-image-60" title="screengrab" src="http://purplefloyd.files.wordpress.com/2008/10/screengrab.png?w=300&#038;h=276" alt="" width="300" height="276" /></a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=59&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2008/10/05/screengrab-ubiquity-script/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2008/10/screengrab.png?w=300" medium="image">
			<media:title type="html">screengrab</media:title>
		</media:content>
	</item>
		<item>
		<title>Video: Games I&#8217;ve written in MHEG</title>
		<link>http://purplefloyd.wordpress.com/2008/09/19/video-games-ive-written-in-mheg/</link>
		<comments>http://purplefloyd.wordpress.com/2008/09/19/video-games-ive-written-in-mheg/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 14:34:45 +0000</pubDate>
		<dc:creator>shp0ng1e</dc:creator>
				<category><![CDATA[BBC]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[MHEG]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[freesat]]></category>
		<category><![CDATA[freeview]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[interactive tv]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[video games]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=23</guid>
		<description><![CDATA[MHEG is a programming language &#38; middleware found in digital set top boxes in the UK and elsewhere around the world.  This video briefly shows a few games I have written in MHEG while working at the BBC.

The games shown in the video are:-

&#8216;Nibbler&#8217; &#8211; a Snake clone.
&#8216;Bounce!&#8217; &#8211; really more of a tech demo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=23&subd=purplefloyd&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://en.wikipedia.org/wiki/MHEG-5" target="_blank">MHEG</a> is a programming language &amp; middleware found in digital set top boxes in the UK and elsewhere around the world.  This video briefly shows a few games I have written in MHEG while working at the BBC.</p>
<p><span style="text-align:center; display: block;"><a href="http://purplefloyd.wordpress.com/2008/09/19/video-games-ive-written-in-mheg/"><img src="http://img.youtube.com/vi/E8CnvlUKzS4/2.jpg" alt="" /></a></span></p>
<p>The games shown in the video are:-</p>
<ol>
<li>&#8216;Nibbler&#8217; &#8211; a Snake clone.</li>
<li>&#8216;Bounce!&#8217; &#8211; really more of a tech demo than a finished game, but surprisingly fun.  Catch the green blobs but avoid the red one.</li>
<li>&#8216;Ping Pong&#8217; &#8211; pretty self explanatory I think.</li>
</ol>
<p>The games have never been broadcast.  I am hoping the powers that be at the BBC will let them go to air.  What do you think?  Would you like to be able to &#8216;Press Red&#8217; and play games such as these?</p>
<p>Obviously the graphics could do with some work, but these games do at least prove the technology&#8230;</p>
<p>Leave a comment if you&#8217;d like to see the BBC do classic arcade style games on interactive TV.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&blog=1889001&post=23&subd=purplefloyd&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2008/09/19/video-games-ive-written-in-mheg/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">shp0ng1e</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/E8CnvlUKzS4/2.jpg" medium="image" />
	</item>
	</channel>
</rss>