<?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; news</title>
	<atom:link href="http://thespicychicken.com/tag/news/feed/" rel="self" type="application/rss+xml" />
	<link>http://thespicychicken.com</link>
	<description>n'th generation research</description>
	<lastBuildDate>Thu, 10 Jun 2010 22:14:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>iPhone OS 3.0 &#8211; Copy &amp; Paste is Buggy</title>
		<link>http://thespicychicken.com/2009/03/17/iphone-os-30-copy-paste-is-buggy/</link>
		<comments>http://thespicychicken.com/2009/03/17/iphone-os-30-copy-paste-is-buggy/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 04:45:18 +0000</pubDate>
		<dc:creator>Spicy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[copy&paste]]></category>
		<category><![CDATA[iphone3.0]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://thespicychicken.com/?p=119</guid>
		<description><![CDATA[As an iPhone developer I have been able to the play around with the new 3.0 firmware. Overall I have to say that I am very pleased.  I think my favorite new feature so far is the search.  It pretty much looks and behaves just like QuickGold, if you have a jailbroken phone [...]]]></description>
			<content:encoded><![CDATA[<p>As an iPhone developer I have been able to the play around with the new 3.0 firmware. Overall I have to say that I am very pleased.  I think my favorite new feature so far is the search.  It pretty much looks and behaves just like QuickGold, if you have a jailbroken phone and have used that before.  Very handy.</p>
<p>What I have found most dissapointing is the interface for Copy and Paste.  I loaded up the CNN front page and tried to copy a few phrases.  It didn&#8217;t go so well.  It keeps trying to copy the entire text.  Then it displays little crop buttons, but don&#8217;t even think of trying to use them.  If you drag toward the edge of the screen (like when you&#8217;d want to scroll down) they switch modes and become completely unusable.</p>
<p>Perhaps with some more time I would be able to figure out how to use it nicely, but this is way outside of &#8220;it just works&#8221; right now.  Hopefully the Apple designers will be improving this feature before 3.0 is released to the public.  Otherwise there are going to be a lot of very frustrated people out there.</p>
<p>Oh, and not having to enter my username/password every time I need to log into a website. Priceless.</p>
]]></content:encoded>
			<wfw:commentRss>http://thespicychicken.com/2009/03/17/iphone-os-30-copy-paste-is-buggy/feed/</wfw:commentRss>
		<slash:comments>2</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 control a [...]]]></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>2</slash:comments>
		</item>
		<item>
		<title>In the works.</title>
		<link>http://thespicychicken.com/2009/03/08/in-the-works/</link>
		<comments>http://thespicychicken.com/2009/03/08/in-the-works/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 18:14:43 +0000</pubDate>
		<dc:creator>Spicy</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://thespicychicken.com/2009/03/08/in-the-works/</guid>
		<description><![CDATA[The reason I haven&#8217;t posted in a while is that there are BIG things in the pipeline, that I am dying to tell you about&#8230;just not yet.
Stay tuned!
]]></description>
			<content:encoded><![CDATA[<p>The reason I haven&#8217;t posted in a while is that there are BIG things in the pipeline, that I am dying to tell you about&#8230;just not yet.</p>
<p>Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://thespicychicken.com/2009/03/08/in-the-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
