<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PurpleFloyd&#039;s Blog</title>
	<atom:link href="http://purplefloyd.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://purplefloyd.wordpress.com</link>
	<description>Linux, amateur game development, interactive TV, stuff like that...</description>
	<lastBuildDate>Wed, 18 Jan 2012 13:43:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='purplefloyd.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>PurpleFloyd&#039;s Blog</title>
		<link>http://purplefloyd.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://purplefloyd.wordpress.com/osd.xml" title="PurpleFloyd&#039;s Blog" />
	<atom:link rel='hub' href='http://purplefloyd.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Parsing ID3 tags in Bash and renaming MP3s</title>
		<link>http://purplefloyd.wordpress.com/2011/01/29/parsing-id3-tags-in-bash-and-renaming-mp3s/</link>
		<comments>http://purplefloyd.wordpress.com/2011/01/29/parsing-id3-tags-in-bash-and-renaming-mp3s/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 01:04:28 +0000</pubDate>
		<dc:creator>purplefloyd</dc:creator>
		
		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=582</guid>
		<description><![CDATA[(Subtitle: Using Bash when I probably shouldn&#8217;t&#8230;) First, let&#8217;s define a bunch of useful functions.  We&#8217;ll later use these functions to extract the relevant sections of our ID3 tags.  I&#8217;m going to assume you are using your interpreter directly, so lets copy &#38; paste the following lines straight into your terminal: function tag() { tail [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=582&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(Subtitle: Using <a href="http://en.wikipedia.org/wiki/Bash_%28Unix_shell%29">Bash</a> when I probably shouldn&#8217;t&#8230;)</p>
<p>First, let&#8217;s define a bunch of useful functions.  We&#8217;ll later use these functions to extract the relevant sections of our <a href="http://en.wikipedia.org/wiki/ID3">ID3 tags</a>.  I&#8217;m going to assume you are using your interpreter directly, so lets copy &amp; paste the following lines straight into your terminal:</p>
<pre>function tag() { tail -c 128 "$1" | head -c 3; }
function title() { tail -c 125 "$1" | head -c 30 | rtrim; }
function artist() { tail -c 95 "$1" | head -c 30 | rtrim; }
function album() { tail -c 65 "$1" | head -c 30 | rtrim; }
function year() { tail -c 35 "$1" | head -c 4 | rtrim; }
function comment() { tail -c 31 "$1" | head -c 28 | rtrim; }
function track() { tail -c 3 "$1" | hexdump -ve '/1 "%02i "' \
                   | awk '{ if ($1 == 0 &amp;&amp; $2 != 0) print $2" " }'; }
function genre() { tail -c 1 "$1" | hexdump -ve '/1 "%03i"'; }

function rtrim() { sed 's/\([^ ]*\) *$/\1/'; }
function filt() { tr -d '/*?'; }</pre>
<p>Now lets say the current directory is full of MP3s that we would like to move to an appropriate folder and give a more appropriate filename (in my case, I had my corrupt old iPod from which I was attempting to extract all the music I could).  The structure I&#8217;m aiming for is:</p>
<p>ARTIST &#8211; ALBUM / TRACK_NUMBER ARTIST &#8211; SONG_NAME</p>
<p>Making use of our functions defined above, this for loop ought to do the trick:</p>
<pre>for file in *.mp3; do [ "$(tag "$file")" == "TAG" ] &amp;&amp; \
    (  artist="$(artist "$file" | filt)"; \
       album="$(album "$file" | filt)"; \
       title="$(title "$file" | filt)"; \
       track="$(track "$file" | filt)"; \
       dir="$artist - $album"; \
       newfile="$track$artist - $title.mp3"; \
       \
       mkdir -p "$dir"; \
       mv "$file" "$dir/$newfile"); \
    done</pre>
<p>And indeed this &#8220;one liner&#8221; did a reasonable job on my MP3 collection, YMMV.</p>
<p>Of course this only works for ID3v1 tags and doesn&#8217;t support &#8220;extended&#8221; v1 tags.</p>
<p>I can&#8217;t imagine ID3v2 possibly being parsed in bash, but I&#8217;d like to be proved wrong <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/purplefloyd.wordpress.com/582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/purplefloyd.wordpress.com/582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/582/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/582/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/582/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=582&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2011/01/29/parsing-id3-tags-in-bash-and-renaming-mp3s/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</media:title>
		</media:content>
	</item>
		<item>
		<title>BBC Open Sources MHEG+ Toolkit</title>
		<link>http://purplefloyd.wordpress.com/2010/08/20/bbc-open-sources-mheg-toolkit/</link>
		<comments>http://purplefloyd.wordpress.com/2010/08/20/bbc-open-sources-mheg-toolkit/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 16:04:57 +0000</pubDate>
		<dc:creator>purplefloyd</dc:creator>
				<category><![CDATA[MHEG]]></category>
		<category><![CDATA[Red Button]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=523</guid>
		<description><![CDATA[Some very good news for all the MHEG developers out there, the BBC have this week open sourced the MHEG+ toolkit and it can be downloaded over at the MHEG+ SourceForge page. The release comes with little in the way of tutorials and so it might all seem a little daunting at first. But having [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=523&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_531" class="wp-caption alignright" style="width: 310px"><a href="http://purplefloyd.files.wordpress.com/2010/08/mheg_player_and_editor_small.png"><img class="size-medium wp-image-531" src="http://purplefloyd.files.wordpress.com/2010/08/mheg_player_and_editor_small.png?w=300&#038;h=202" alt="" width="300" height="202" /></a><p class="wp-caption-text">MHEG Player showing the Freesat Red Button homepage</p></div>
<p>Some very good news for all the MHEG developers out there, the BBC have this week open sourced the MHEG+ toolkit and it can be downloaded over at the <a href="http://sourceforge.net/projects/mhegplus/">MHEG+ SourceForge page</a>.</p>
<p>The release comes with little in the way of tutorials and so it might all seem a little daunting at first.  But having used (and worked on) the toolkit for a couple of years I think it is worth the initial effort and recommend you give it a try.</p>
<p>I intend to write a full getting started guide to help new users over on the <a href="http://sourceforge.net/projects/mhegplus/forums/forum/1172868">MHEG+ SourceForge forum</a>, but for now here are some code examples and an ultra-quick guide to getting the toolkit up &amp; running&#8230;</p>
<p><strong>Code Examples</strong></p>
<p>There is a simple &#8220;Hello World&#8221; MHEG+ application downloadable from the <a href="http://mhegplus.svn.sourceforge.net/viewvc/mhegplus/trunk/MhegPlus.MhegPlayer/mheg%2B_example/">MHEG+ subversion repository</a>.</p>
<p>This blog also has two examples of MHEG+ code, see these posts <a href="/mheg-game-development-tutorial-part-1-timing">#1</a>, <a href="/mheg-game-development-tutorial-part-2-animation">#2</a>.</p>
<p><strong>Ultra-quick MHEG+ getting started guide</strong></p>
<p>The toolkit contains a compiler and an emulator.  Currently both are available for download as a separate Java .jar files.  You will need Java installed to use them.</p>
<p>To use the emulator/debugger, download the file named MhegPlus.MhegPlayer-1.0.1.jar and issue the command:</p>
<p><code>java -jar MhegPlus.MhegPlayer-1.0.1.jar</code></p>
<p>This will launch the Mheg Player GUI.</p>
<p>To use the compiler first download the file named MhegPlus.Compiler-1.0.1.jar.  The compiler can invoked with the following command, but you will need to pass command-line options to get anything meaningful out of it:</p>
<p><code>java -jar MhegPlus.Compiler-1.0.1.jar</code></p>
<p>You can get help on the various compiler options by passing &#8211;help, e.g.:</p>
<p><code>java -jar MhegPlus.Compiler-1.0.1.jar --help<br />
usage: mhegplus<br />
-p,--output-app                  output application file? (optional)<br />
-d,--output-dir                  output directory (optional)<br />
-P,--output-app-sans-extension   output application file as a or startup<br />
(optional)<br />
-l,--log-level                   log level<br />
(FINE|INFO|WARNING|ERROR|SEVERE)<br />
-a,--asn1                        select ASN.1 output (default)<br />
-f,--application                 application file<br />
-h,--help                        print this help<br />
-t,--text                        select text output<br />
-v,--version                     report version number</code></p>
<p><strong>Happy MHEG+ing!</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/purplefloyd.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/purplefloyd.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/523/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/523/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=523&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2010/08/20/bbc-open-sources-mheg-toolkit/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2010/08/mheg_player_and_editor_small.png?w=300" medium="image" />
	</item>
		<item>
		<title>Working on a new HTML5 game engine for iPhone</title>
		<link>http://purplefloyd.wordpress.com/2010/02/24/html5-game-engine-for-iphone/</link>
		<comments>http://purplefloyd.wordpress.com/2010/02/24/html5-game-engine-for-iphone/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 08:33:41 +0000</pubDate>
		<dc:creator>purplefloyd</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=471</guid>
		<description><![CDATA[I&#8217;ve just completed the first stage of development on a new 2D HTML5 game engine for iPhone. It is a complete re-write of the engine used in my iPhone platform game and it achieves a much higher and more consistent frame rate. I&#8217;m currently very pleased to be getting a consistent 17-18 FPS running full [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=471&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just completed the first stage of development on a new 2D HTML5 game engine for iPhone.</p>
<p>It is a complete re-write of the engine used in <a href="/html5-platform-game-for-iphone">my iPhone platform game</a> and it achieves a much higher and more consistent frame rate. I&#8217;m currently very pleased to be getting a consistent 17-18 FPS running full screen on an iPhone 3G.</p>
<p>It is a scrolling tile-based engine, meaning it should suitable for most 2D games. I&#8217;d like to use it to create another platformer, or maybe a shoot &#8216;em up this time would be cool, but the engine could be used for other game types too.</p>
<div align="center"><img src="http://purplefloyd.files.wordpress.com/2010/02/artistwanted.png?w=600" alt="Artist Wanted!" title="ArtistWanted"   class="alignnone size-full wp-image-473" /></div>
<p><strong>I need your help!</strong> to turn it into a finished game.  This is a call out to any artists who would like to get involved, please drop me an email with examples of your work. My address can be found on the <a href="/about">about page</a>.</p>
<p>I intend to release 2 versions of the game:-</p>
<ul>
<li>a demo version that runs in Mobile Safari but has no sound and few levels, and
</li>
<li>a full version that can be purchased from the app store.
</li>
</ul>
<p>Revenues made from the app store version would be shared with the artist, so there might even be a few dollars in it for you!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/purplefloyd.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/purplefloyd.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/471/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=471&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2010/02/24/html5-game-engine-for-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2010/02/artistwanted.png" medium="image">
			<media:title type="html">ArtistWanted</media:title>
		</media:content>
	</item>
		<item>
		<title>HTML5 Platform Game for iPhone</title>
		<link>http://purplefloyd.wordpress.com/2010/02/04/html5-platform-game-for-iphone/</link>
		<comments>http://purplefloyd.wordpress.com/2010/02/04/html5-platform-game-for-iphone/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 01:32:11 +0000</pubDate>
		<dc:creator>purplefloyd</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://purplefloyd.wordpress.com/?p=356</guid>
		<description><![CDATA[I&#8217;ve spent today porting my HTML 5 platformer, mentioned in an earlier post, to run on iPhone/iPod Touch. The game uses the HTML 5 Canvas element and a few iPhone-specific HTML/JS extensions. It should still run on most desktop and mobile web browsers however. I&#8217;ve tested the game on an iPhone 3G and 3Gs. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=356&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://purplefloyd.files.wordpress.com/2010/02/img_0397.png"><img class="alignright size-medium wp-image-358" title="screenshot" src="http://purplefloyd.files.wordpress.com/2010/02/img_0397.png?w=300&#038;h=200" alt="" width="300" height="200" /></a>I&#8217;ve spent today porting my HTML 5 platformer, mentioned in an <a href="/a-platform-game-written-in-html5/">earlier post</a>, to run on iPhone/iPod Touch.</p>
<p>The game uses the <a href="http://en.wikipedia.org/wiki/Canvas_element">HTML 5 Canvas</a> element and a few iPhone-specific HTML/JS extensions. It should still run on most desktop and mobile web browsers however.</p>
<p>I&#8217;ve tested the game on an iPhone 3G and 3Gs. The 3Gs performs as well as a desktop PC which is some feat! The 3G on the other had is a little sluggish, but the game is still playable; if you&#8217;re using a 3G I recommend playing the game with your phone upright (portrait) for best performance, since in this mode the game aims to draw to a smaller area of the display.</p>
<p>It is also possible to play the game full screen, that is without the Safari address bar &amp; toolbar, by adding the game to your home screen.</p>
<p>According to <a href="http://twitter.com/liamgh/status/8631052476">Liam Green-Hughes on Twitter</a>, the game also runs fine on the Nokia N900, running Firefox.</p>
<p>See my <a href="/a-platform-game-written-in-html5/">earlier post</a> for the history of the game, or to play the desktop version.  As before I invite you to take a look at the source code of the game.  Simply hit your browser&#8217;s &#8220;view source&#8221; button to read the code.</p>
<p>Click the Play link below (ideally on your iPhone!) and be sure to leave a comment with your thoughts.</p>
<h1 style="text-align:center;margin-bottom:8px;"><a href="http://www.watersheep.org/~markh/canvas_touch/game.html">Play!</a></h1>
<p>Or go to this address on your iPhone: <a href="http://tinyurl.com/purplefloyd">http://tinyurl.com/purplefloyd</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/purplefloyd.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/purplefloyd.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/purplefloyd.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/purplefloyd.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/purplefloyd.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/purplefloyd.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/purplefloyd.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/purplefloyd.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/purplefloyd.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/purplefloyd.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/purplefloyd.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/purplefloyd.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=356&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2010/02/04/html5-platform-game-for-iphone/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2010/02/img_0397.png?w=300" medium="image">
			<media:title type="html">screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>A Platform Game Written in HTML5</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>purplefloyd</dc:creator>
				<category><![CDATA[html5]]></category>
		<category><![CDATA[game development]]></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 HTML5/Javascript. It&#8217;s a kind of Mario clone and at the time I named it &#8220;Fred Jones in Adventureland&#8221;&#8230; hmm, not a great name. The themes of the game are intended to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=278&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_285" class="wp-caption alignright" style="width: 310px"><a href="http://www.watersheep.org/~markh/html_canvas/game.html"><img class="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><p class="wp-caption-text">Click to play</p></div>
<p>Nearly 15 years ago, when I was all of 15 years old, I wrote this little platform game which I have recently ported to HTML5/Javascript.</p>
<p>It&#8217;s 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>The themes of the game are intended to be tongue-in-cheek however.  Hence the ridiculous title and deliberately unsubtle references to other games in the genre.</p>
<p>And it is somewhat incomplete; the player has unlimited lives and unfortunately there are only 5 levels.  But as it stands it is playable and hopefully a little bit of fun.  There are a couple of surprises along the way too.</p>
<h5>Browser Compatibility</h5>
<p>If you&#8217;re using Microsoft Internet Explorer 7 or 8 the game will run dreadfully 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 I recommend you install it.)</p>
<p>Internet Explorer 6 and earlier, Firefox 1.x and I believe Opera 8 and previous will not run the game at all.  This is because these older browsers do not support HTML5 (arguably, no version of Internet Explorer supports HTML5, however the game can run with the assistance of 3rd-party plug-ins and other workarounds).  Please upgrade or switch to a different browser.</p>
<h5>Controls</h5>
<p>Left Arrow: move left<br />
Right Arrow: move right<br />
Spacebar: jump</p>
<h5>iPhone Version</h5>
<p>See <a href="/html5-platform-game-for-iphone/">HTML5 Platform Game for iPhone</a></p>
<h1 style="text-align:center;"><a href="http://www.watersheep.org/~markh/html_canvas/game.html">Play!</a></h1>
<p style="text-align:center;">Click the link above to play the game.</p>
<h5>Technical Details</h5>
<p>This 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 in any modern web browser.</p>
<p>Unlike most web games <strong><em>the game does not use Flash</em></strong>.  The HTML5 Canvas is used to draw 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 Canvas drawing operations and javascript run-times in most modern browsers. However Internet Explorer users apparently will have to wait for version 10 before such features will grace the browser.</p>
<p>The game currently has no sound but this could be added using the HTML5 &lt;audio&gt; element.</p>
<br />  <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/gofacebook/purplefloyd.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=1889001&amp;post=278&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/09/11/a-platform-game-written-in-html5/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</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>I&#8217;m on BBC News online!</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>purplefloyd</dc:creator>
				<category><![CDATA[Red Button]]></category>
		<category><![CDATA[BBC]]></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;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=262&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<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 <strong>Features, Views and Analysis</strong> section.</p>
<p><a href="http://www.bbc.co.uk/blogs/pressred/2009/03/redbuttonarcade.shtml"><img class="size-full wp-image-350 alignnone" title="Click to read article" src="http://purplefloyd.files.wordpress.com/2009/03/bbcnewstechfeatures1.png?w=600" alt=""   /></a></p>
<p>Must have been a slow news day&#8230;</p>
<br />  <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/gofacebook/purplefloyd.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=1889001&amp;post=262&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></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=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</media:title>
		</media:content>

		<media:content url="http://purplefloyd.files.wordpress.com/2009/03/bbcnewstechfeatures1.png" medium="image">
			<media:title type="html">Click to read article</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>purplefloyd</dc:creator>
				<category><![CDATA[Red Button]]></category>
		<category><![CDATA[BBC]]></category>
		<category><![CDATA[freeview]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[interactive tv]]></category>
		<category><![CDATA[MHEG]]></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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=257&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<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>
<p><strong>Update:</strong> The post is now <a href="/im-on-bbc-news">linked to from the front page of the BBC News Technology section</a>.</p>
<br />  <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/gofacebook/purplefloyd.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/257/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/257/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=1889001&amp;post=257&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></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=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</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>purplefloyd</dc:creator>
				<category><![CDATA[Red Button]]></category>
		<category><![CDATA[BBC]]></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&amp;blog=1889001&amp;post=252&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<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>
<br />  <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/gofacebook/purplefloyd.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/252/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/252/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=1889001&amp;post=252&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></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=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</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>purplefloyd</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[debian]]></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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=230&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<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>debsig-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 /><tt><strong>$ gpg --gen-key</strong></tt><br />and follow the steps.</li>
<p> <span id="more-230"></span></p>
<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 /><tt><strong>$ ar x my_package_1_0_0.deb</strong></tt></li>
<li>Concatenate its contents (the order is important), and output to a temp file:<br /><tt><strong>$ cat debian-binary control.tar.gz data.tar.gz &gt; /tmp/combined-contents</strong></tt></li>
<li>Create a GPG signature of the concatenated file, calling it <tt>_gpgorigin</tt>:<br /><tt><strong>$ gpg -abs -o _gpgorigin /tmp/combined-contents</strong></tt></li>
<li>Finally, bundle the .deb up again, including the signature file:<br /><tt><strong>$ ar rc my_package_1_0_0.deb \<br />
&nbsp;&nbsp;&nbsp;&nbsp;_gpgorigin debian-binary control.tar.gz data.tar.gz</strong></tt></li>
</ol>
</li>
<li>Export your signing public key and determine its key id.
<ol>
<li>Export your public key:<br /><tt><strong>$ gpg --export -a &gt; my-debsig.asc</strong></tt></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 /><tt><strong>$ gpg --fingerprint<br />
/home/floyd/.gnupg/pubring.gpg<br />
------------------------------<br />
pub   1024D/0695623E 2009-02-04<br />
Key fingerprint = 6577 AAB2 8850 9E0B 1059  C510 CA58 BC6A 0695 623E<br />
uid                  Purple (Floyd) &lt;--your email address--&gt;<br />
sub   2048g/EB122979 2009-02-04</strong></tt></li>
</ol>
</li>
<li>Setup the machine(s) that will be downloading and verifying the package.
<ol>
<li>Install the debsig-verify package:<br /><tt><strong>$ apt-get install debsig-verify</strong></tt></li>
<li>Import the public key into the debsig keyring:<br /><tt><strong>$ mkdir /usr/share/debsig/keyrings/[key_id]<br />
$ gpg --no-default-keyring --keyring \<br />
&nbsp;&nbsp;&nbsp;&nbsp;/usr/share/debsig/keyrings/[key_id]/debsig.gpg --import my-debsig.asc</strong></tt></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 /><tt><strong>&lt;?xml version="1.0"?&gt;<br />
&lt;!DOCTYPE Policy SYSTEM "http://www.debian.org/debsig/1.0/policy.dtd"&gt;<br />
&lt;Policy xmlns="http://www.debian.org/debsig/1.0/"&gt;</strong></p>
<p><strong> &lt;Origin Name="PurpleFloyd" id="CA58BC6A0695623E"<br />
Description="Another package from PurpleFloyd"/&gt;</strong></p>
<p><strong> &lt;Selection&gt;<br />
&lt;Required Type="origin" File="debsig.gpg" id="CA58BC6A0695623E"/&gt;<br />
&lt;/Selection&gt;</strong></p>
<p><strong> &lt;Verification MinOptional="0"&gt;<br />
&lt;Required Type="origin" File="debsig.gpg" id="CA58BC6A0695623E"/&gt;<br />
&lt;/Verification&gt;</strong></p>
<p><strong>&lt;/Policy&gt;</strong></tt></li>
</ol>
</li>
<li>You should now be able to verify the package using <tt>debsig-verify</tt>, i.e.:<br /><tt><strong>$ debsig-verify my_package_1_0_0.deb<br />
debsig: Verified package from `PurpleFloyd' (Another package from PurpleFloyd)</strong></tt></li>
</ol>
<p>Et voila!  You have signed and verified a debian package.</p>
<p>Note: 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>
<br />  <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/gofacebook/purplefloyd.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=1889001&amp;post=230&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2009/02/05/signing-deb-packages/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</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>purplefloyd</dc:creator>
				<category><![CDATA[MHEG]]></category>
		<category><![CDATA[BBC]]></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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=purplefloyd.wordpress.com&amp;blog=1889001&amp;post=123&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<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=600" alt="pacs"   /></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=600" alt="pacanim"   /></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=600" alt="0.png"   /></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=600" alt="1.png"   /></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=600" alt="2.png"   /></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=600" alt="3.png"   /></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=600" alt="4.png"   /></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>
<br />  <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/gofacebook/purplefloyd.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/purplefloyd.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/purplefloyd.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/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&amp;blog=1889001&amp;post=123&amp;subd=purplefloyd&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://purplefloyd.wordpress.com/2008/12/14/mheg-game-development-tutorial-part-2-animation/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0c88f785a29930c19b6d44ebfd81400a?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">purplefloyd</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>
	</channel>
</rss>
