<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dual Elephants &#187; Game</title>
	<atom:link href="http://www.adebenham.com/category/arduino/peggy/peggy-game/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adebenham.com</link>
	<description>Always keep a spare for redundancy</description>
	<lastBuildDate>Sun, 21 Feb 2010 22:18:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Peggy 2 multi-game sketch v0.2</title>
		<link>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-2/</link>
		<comments>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-2/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 00:28:23 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Peggy 2]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=48</guid>
		<description><![CDATA[I&#8217;ve done a lot more work on the multi-game sketch for my Peggy2 &#8211; mostly to add functionality and fix up a few &#8216;issues&#8217;
See the original post  for more details on what is included
Download it from here When compiled it uses 13808 bytes so there only a bit of room to spare.
I&#8217;ve added a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve done a lot more work on the multi-game sketch for my Peggy2 &#8211; mostly to add functionality and fix up a few &#8216;issues&#8217;<br />
See the original post <a href="http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/">here</a> for more details on what is included<br />
Download it from <a href="/files/arduino/peggy2_games_0.2.zip">here</a> When compiled it uses 13808 bytes so there only a bit of room to spare.<br />
I&#8217;ve added a two player version of pong (use up/down buttons to control player two &#8211; I&#8217;ve made a separate plug-in controller for player two to make things easier to use)<br />
I&#8217;ve fixed up the &#8216;breakout&#8217; clone so it actually can be considered a &#8216;game&#8217; <img src='http://www.adebenham.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
I also added a &#8216;demo&#8217; game which just lights up all leds with a nice grayscale pattern than can be moved around via the direction buttons (press select to stop the motion)<br />
The other main thing is that it now has sound!<br />
With the release of arduino-0018 they added a function &#8216;tone&#8217; to generate square waves on a digital pin. I connected a piezo speaker (from a headphone) to ADC5 and generated the tones on that pin.<br />
There is intro music at the game select screen, music when displaying the score and various bips and beeps while playing the games.<br />
To make the music I wrote a small perl script to convert MusicXML files to a suitable include file (will be documented in a separate post)<br />
Adding the music and extra games meant I was hitting the space limits in the AVR so there is a bit of &#8216;dodgyness&#8217; in the code so that it would fit.</p>
<p>See the original post <a href="http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/">here</a> for more details on what is included</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peggy 2 multi-game sketch v0.1</title>
		<link>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/</link>
		<comments>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 22:26:30 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Peggy 2]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=17</guid>
		<description><![CDATA[I had such fun writing the simple &#8217;snake&#8217; game for my peggy 2 that I wrote a bunch of other games for it as well.
At the moment there is Snake, Breakout, Pong and Race.
You can download the sketch as peggy2_games_0.1.zip
When compiled it takes up 11432 bytes (it includes the &#8216;Tone&#8217; library as I have started [...]]]></description>
			<content:encoded><![CDATA[<p>I had such fun writing the simple &#8217;snake&#8217; game for my peggy 2 that I wrote a bunch of other games for it as well.</p>
<p>At the moment there is Snake, Breakout, Pong and Race.</p>
<p>You can download the sketch as <a href="/files/arduino/peggy2_games_0.1.zip">peggy2_games_0.1.zip</a></p>
<p>When compiled it takes up 11432 bytes (it includes the &#8216;Tone&#8217; library as I have started adding sound to the sketch &#8211; connect speaker to ADC5 to hear it)</p>
<h2>Starting peggy2_game</h2>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/game_menu.jpg"><img class="aligncenter size-full wp-image-19" title="Game menu" src="http://www.adebenham.com/wp-content/uploads/2010/02/game_menu.jpg" alt="Game menu" width="300" height="327" /></a></p>
<p>When you turn on the peggy2 a menu is presented displaying the available games &#8211; you can select from them using the up/down buttons and select with the &#8217;select&#8217; or &#8216;any&#8217; button on the left of the peggy2.  Only three game names fit on the screen at once so the entire display scrolls up/down when changing game (and highlights the current selection)  To change games press the reset button.</p>
<h2>Playing the games</h2>
<h3>Snake</h3>
<p style="text-align: center;"><a href="http://www.adebenham.com/wp-content/uploads/2010/02/snake.jpg"><img class="alignnone size-full wp-image-21" title="Snake" src="http://www.adebenham.com/wp-content/uploads/2010/02/snake.jpg" alt="Snake" width="300" height="309" /></a><a href="http://www.adebenham.com/wp-content/uploads/2010/02/level_select.jpg"><img class="alignnone size-full wp-image-20" title="Level select" src="http://www.adebenham.com/wp-content/uploads/2010/02/level_select.jpg" alt="Level select" width="300" height="307" /></a></p>
<p>When the game first starts you can choose which level to start at.  There are four different boards available &#8211; these boards are re-used in a loop just at a higher speed for later levels.</p>
<p>Eat the &#8216;apples&#8217; to get points, don&#8217;t hit yourself or walls</p>
<p>Arrow buttons control movement of the snake.</p>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/score.jpg"><img class="aligncenter size-full wp-image-22" title="Score screen" src="http://www.adebenham.com/wp-content/uploads/2010/02/score.jpg" alt="Score screen" width="300" height="299" /></a></p>
<h3>Pong</h3>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/pong.jpg"><img class="aligncenter size-full wp-image-23" title="Pong game" src="http://www.adebenham.com/wp-content/uploads/2010/02/pong.jpg" alt="Pong game" width="300" height="292" /></a></p>
<p>Hit the ball back, get a point if the AI misses, AI gets the point if you miss</p>
<p>Left/right buttons control movement of the bottom paddle (one player only for the moment)</p>
<h3>Break</h3>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/break.jpg"><img class="aligncenter size-full wp-image-24" title="Breakout game" src="http://www.adebenham.com/wp-content/uploads/2010/02/break.jpg" alt="Breakout game" width="300" height="284" /></a></p>
<p>Not much here yet, just displays a bouncing ball + blocks to hit</p>
<p>Left/right buttons control movement of the paddle</p>
<h3>Race</h3>
<p><a href="http://www.adebenham.com/wp-content/uploads/2010/02/race.jpg"><img class="aligncenter size-full wp-image-25" title="Race game" src="http://www.adebenham.com/wp-content/uploads/2010/02/race.jpg" alt="Race game" width="300" height="280" /></a></p>
<p>Avoid the walls.  One point every 25 blocks driven past, walls get narrower every 25 points</p>
<p>Left/right buttons control movement of the car.</p>
<p>peggy2_games.zip</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/02/peggy-2-multi-game-sketch-v0-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Peggy 2 Snake</title>
		<link>http://www.adebenham.com/2010/01/peggy-2-snake/</link>
		<comments>http://www.adebenham.com/2010/01/peggy-2-snake/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 03:32:30 +0000</pubDate>
		<dc:creator>cjd</dc:creator>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Peggy 2]]></category>

		<guid isPermaLink="false">http://www.adebenham.com/?p=13</guid>
		<description><![CDATA[For Christmas my wife gave me a peggy 2 and I finally got around to building it.
It has 24&#215;25 White LEDs with a row of 25 Red LEDs across the bottom.
By having that bottom row a different colour I can use that section for displaying score or other information
The first application I wrote for it [...]]]></description>
			<content:encoded><![CDATA[<p>For Christmas my wife gave me a <a href="http://evilmadscience.com/tinykitlist/75">peggy 2</a> and I finally got around to building it.</p>
<div id="attachment_14" class="wp-caption aligncenter" style="width: 209px"><a href="http://www.adebenham.com/wp-content/uploads/2010/01/Peggy2_snake.jpg"><img class="size-medium wp-image-14" title="Peggy2_snake" src="http://www.adebenham.com/wp-content/uploads/2010/01/Peggy2_snake-199x300.jpg" alt="Peggy 2 running Snake" width="199" height="300" /></a><p class="wp-caption-text">Peggy 2 running Snake</p></div>
<p>It has 24&#215;25 White LEDs with a row of 25 Red LEDs across the bottom.</p>
<p>By having that bottom row a different colour I can use that section for displaying score or other information</p>
<p>The first application I wrote for it the good old game of &#8216;Snake&#8217;.  After writing a quick version of the game I realised it needed a bit more &#8216;flair&#8217; and so added the ability to display an intro screen and score screen.  To make this easier I wrote a bunch of utility functions to display characters that are stored in an array. I&#8217;ll describe how this works in a separate post as <a href="http://www.adebenham.com/2010/01/peggy-2-character-display/">Peggy 2 Character display</a>.</p>
<p>The game has multiple levels (where walls are put up in different spots and the speed is increased).  All up the program takes up 5258 bytes so fits on an atmega168 with room to spare.</p>
<p>Source code is available as <a href="/files/arduino/peggy2_snake.zip">peggy2_snake.zip</a></p>
<p>If you don&#8217;t have all the leds soldered on you can change gameMinX, gameMaxX, gameMinY, gameMaxY and score* to set the area used to play/display score</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adebenham.com/2010/01/peggy-2-snake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
