<?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>TheSpicyChicken &#187; iphone</title>
	<atom:link href="http://thespicychicken.com/tag/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://thespicychicken.com</link>
	<description>n'th generation research</description>
	<lastBuildDate>Sun, 27 Nov 2011 19:17:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Trick your friends&#8230;</title>
		<link>http://thespicychicken.com/2009/03/14/trick-your-friends/</link>
		<comments>http://thespicychicken.com/2009/03/14/trick-your-friends/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 01:52:58 +0000</pubDate>
		<dc:creator>Spicy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[guppy]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://thespicychicken.com/2009/03/14/trick-your-friends/</guid>
		<description><![CDATA[Are your friends Gullible? Trick them with Guppy a free iPhone app. I don&#8217;t want to give too much away, but it&#8217;s loads of fun and it&#8217;s free. Download it now and have some fun with your friends! Free Download here. -Spicy]]></description>
			<content:encoded><![CDATA[<p>Are your friends Gullible?  Trick them with <a href="http://mophilia.com">Guppy</a> a free iPhone app.</p>
<p>I don&#8217;t want to give too much away, but it&#8217;s loads of fun and it&#8217;s free.  Download it now and have some fun with your friends!</p>
<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305450679&#038;mt=8">Free Download here.</a></p>
<p>-Spicy</p>
]]></content:encoded>
			<wfw:commentRss>http://thespicychicken.com/2009/03/14/trick-your-friends/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PopBalloons and making Demonstration Videos</title>
		<link>http://thespicychicken.com/2009/03/08/demonstration-videos/</link>
		<comments>http://thespicychicken.com/2009/03/08/demonstration-videos/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 19:13:48 +0000</pubDate>
		<dc:creator>Spicy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://thespicychicken.com/?p=93</guid>
		<description><![CDATA[Background While learning how to use the microphone on the iPhone to record I thought a quick and fun iPhone Game which leverages the microphone on the phone. There&#8217;s lots of apps out there that take advantage of the accelerometers, but not too many that use the microphone as a control device.  In PopBalloons you [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Background</strong></p>
<p>While learning how to use the microphone on the iPhone to record I thought a quick and fun iPhone Game which leverages the microphone on the phone.</p>
<p>There&#8217;s lots of apps out there that take advantage of the accelerometers, but not too many that use the microphone as a control device.  In PopBalloons you control a laser that floats around the screen (using the accelerometers, of course <img src='http://thespicychicken.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , but to fire the laser you need to make a sound.  A snap, a click, sing a song, whatever.  The intensity of the laser is directly proportional to the intensity of the sound that the iPhone hears.  You can even slightly tap the microphone with your finger, if you really need to be quiet.</p>
<p>As an added bonus, I cartooned up some LOL cats, and instead of popping balloons with your sound-laser, you can pop LOL-CATS!  I know, it&#8217;s brilliant. More information on PopBalloons, and all of my future mobile phone apps can be found at the website of my new company, <a href="http://mophilia.com">Mophilia, Inc</a>.</p>
<p><strong>Demonstration Videos</strong></p>
<p>The real point to this post is to demonstrate how to make a crude demonstration video of a live-action game.  My first thought was to take screenshots using the screen shot function and then string them into a video.</p>
<div class="code">CGImageRef screen = UIGetScreenImage();<br />
UIImage *viewImage = [UIImage imageWithCGImage:screen];<br />
CGImageRelease(screen);</div>
<p>However, the process of getting the screen shot and saving it takes way to long and eats up too much memory to be run at full speed.  So it occurred to me, that since the game is being triggered by timers which are on the order of 30fps then I could slow the game down and take screenshots between the frames.  For example, if I slowed the entire gameplay down to 10fps then I could take screenshots at that rate and not run into memory issues. So in my PopBalloons_Prefix.pch file I have this:</p>
<div class="code">// This is the master Timer update frequency.  Normal speed is 30.<br />
#define PopBalloonsMasterFrequency 10</div>
<p>All of the rest of the frequencies are based on this one.  So if I have a timer that normally runs at 20fps I would simply redefine the frequency like this:</p>
<div class="code">// Nomal update frequency is 20 Hz<br />
#define kUpdateFrequency ((2./3.)*PopBalloonsMasterFrequency)</div>
<p>Now I can arbitrarily slow down my entire game so that I can do CPU and memory taxing procedures.  In case you are interested I save the images to file using:</p>
<div class="code">NSData *imgData = UIImagePNGRepresentation(viewImage);<br />
if (![imgData writeToFile:filePath atomically:NO]) {<br />
NSLog(@&#8221;Failed to write the image data to file.&#8221;);<br />
}</div>
<p>Where filePath is an NSString object that contains the full path to the destination file and viewImage is a UIImage object from the code above.</p>
<p><strong>Encoding the PNG files into a Video</strong></p>
<p>Now that I have a whole bunch of images I need to encode them into a movie. I use mencoder to do this. Mencoder comes with MPlayer which can be installed using Darwin Ports.</p>
<div class="code">#port install MPlayer</div>
<p>Note you need to have /opt/local/bin set in your PATH file.</p>
<p>I wanted the video to include an image of the phone, so it the game looks like it is being played.  To do so I just used Grab to take a screenshot of the simulator and saved that file as PhoneImage.png in the same directory as my screenshot files.  Now I can use some a handy python script to combine the images and generate what will be the frame for my video.</p>
<div class="code">import os<br />
from PIL import Image</p>
<p>phone_image_name = &#8216;PhoneImage.png&#8217;<br />
file_names = [f for f in os.listdir('.') if not os.isdir(f) and not f.split('_')[-1] == &#8216;done.png&#8217; and not f.split(&#8216;.&#8217;)[-1] == &#8216;py&#8217; and not f in [phone_image_name] and not f[0] == &#8216;.&#8217;]</p>
<p>for file_name in file_names:<br />
  phone_image = Image.open(phone_image_name)<br />
  im = Image.open(file_name)<br />
  phone_image.paste(im, (63,160))<br />
  phone_image.save(file_name.split(&#8216;.&#8217;)[0] + &#8216;_done.png&#8217;)
</p></div>
<p>After the images are converted I just delete all the old files and then string them together to make a video using mencoder:</p>
<div class="code">mencoder &#8220;mf://*.png&#8221; -mf type=png:w=320:h=480:fps=28 -ovc lavc -lavcopts vcodec=mpeg4 -oac copy -o foo.avi</div>
<p>The product of this is the following video:</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/MFKv1cFQsY8&#038;hl=en&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/MFKv1cFQsY8&#038;hl=en&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>As you can see it&#8217;s far from perfect.  It&#8217;s a little shaky and you can see the flicker of the text prompt in the Text Field, but as a first pass it will do.</p>
<p>-Spicy</p>
]]></content:encoded>
			<wfw:commentRss>http://thespicychicken.com/2009/03/08/demonstration-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Pulse v1.1 Released</title>
		<link>http://thespicychicken.com/2009/02/05/the-pulse-v11-released/</link>
		<comments>http://thespicychicken.com/2009/02/05/the-pulse-v11-released/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 23:40:19 +0000</pubDate>
		<dc:creator>Spicy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[app news]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[pulse]]></category>

		<guid isPermaLink="false">http://thespicychicken.com/?p=80</guid>
		<description><![CDATA[I have received some really good feedback about my first &#8216;official&#8217; iphone application, The Pulse.  Users have really liked the app, but it seem to lack some basic features.  In version 1.1 the ability to pause the onslaught of incoming news articles as well as in-app web viewing has been added. Most importantly, here are [...]]]></description>
			<content:encoded><![CDATA[<p>I have received some really good feedback about my first &#8216;official&#8217; iphone application, The Pulse.  Users have really liked the app, but it seem to lack some basic features.  In version 1.1 the ability to pause the onslaught of incoming news articles as well as in-app web viewing has been added.</p>
<p>Most importantly, here are some screenshots:</p>
<p><img class="alignnone size-full wp-image-82" title="img_0028" src="http://thespicychicken.com/wp-content/uploads/2009/02/img_0028.png" alt="img_0028" width="320" height="480" /> <img class="alignnone size-full wp-image-83" title="img_0031" src="http://thespicychicken.com/wp-content/uploads/2009/02/img_0031.png" alt="img_0031" width="320" height="480" /></p>
<p>You can download the app from:</p>
<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301786228&amp;mt=8">http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301786228&amp;mt=8</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thespicychicken.com/2009/02/05/the-pulse-v11-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First &#8220;official&#8221; iPhone App</title>
		<link>http://thespicychicken.com/2009/01/23/first-official-iphone-app/</link>
		<comments>http://thespicychicken.com/2009/01/23/first-official-iphone-app/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 01:39:31 +0000</pubDate>
		<dc:creator>Spicy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[pulse]]></category>

		<guid isPermaLink="false">http://thespicychicken.com/?p=69</guid>
		<description><![CDATA[Hi all, As I mentioned earlier, my first official iPhone application has come out.  It&#8217;s called The Pulse and is great for killing some extra time.  Keep an eye on the latest from your favorite news sites.  You can download it for free here: http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301786228&#38;mt=8 If you like it and would like to see more [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all,</p>
<p>As I mentioned earlier, my first official iPhone application has come out.  It&#8217;s called The Pulse and is great for killing some extra time.  Keep an eye on the latest from your favorite news sites.  You can download it for free here:</p>
<p><a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301786228&#038;mt=8">http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301786228&amp;mt=8</a></p>
<p>If you like it and would like to see more features shoot me an email.  If there is interest I&#8217;ll expand on the app.</p>
<p>Best,<br />
Spicy</p>
]]></content:encoded>
			<wfw:commentRss>http://thespicychicken.com/2009/01/23/first-official-iphone-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

