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

<channel>
	<title>Get Set Games &#187; Development</title>
	<atom:link href="http://getsetgames.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://getsetgames.com</link>
	<description></description>
	<lastBuildDate>Thu, 29 Jul 2010 19:21:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/><cloud domain='getsetgames.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<link rel="http://api.friendfeed.com/2008/03#sup" xmlns="http://www.w3.org/2005/Atom" type="application/json" href="http://friendfeed.com/api/public-sup.json#5c973c50be"/>		<item>
		<title>How to Animate Sprites in cocos2d</title>
		<link>http://getsetgames.com/2010/04/18/how-to-animate-sprites-in-cocos2d/</link>
		<comments>http://getsetgames.com/2010/04/18/how-to-animate-sprites-in-cocos2d/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 16:08:58 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[CCAnimate]]></category>
		<category><![CDATA[CCAnimation]]></category>
		<category><![CDATA[CCSprite]]></category>
		<category><![CDATA[CCSpriteSheet]]></category>
		<category><![CDATA[cocos2d]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=779</guid>
		<description><![CDATA[One of the most frequently asked questions I see about cocos2d for iPhone is &#8220;how do you animate sprites?&#8221;. This was also one of the first questions we had when developing Addicus. It&#8217;s actually quite simple to do using cocos2d&#8217;s CCSpriteSheet, CCSprite and CCAnimation classes. These classes take a texture atlas and switch between frames [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most frequently asked questions I see about cocos2d for iPhone is &#8220;how do you animate sprites?&#8221;. This was also one of the first questions we had when developing <a href="http://getsetgames.com/games/addicus/">Addicus</a>.</p>
<p>It&#8217;s actually quite simple to do using cocos2d&#8217;s CCSpriteSheet, CCSprite and CCAnimation classes. These classes take a texture atlas and switch between frames at regular intervals. In other words: animation!</p>
<p>Here is how to animate a sprite in cocos2d in 5 steps. You can also <a href='http://getsetgames.com/wp-content/uploads/2010/04/GrossiniDance.zip'>download</a> the code for this blog post.</p>
<h3>1. Create Your Animation Texture Atlas</h3>
<p>First you need to combine all of the frames of your animation into a single graphic, called a texture atlas. You can do this by hand in an image editor like Photoshop, simply by copying and pasting all of the frames of your animation into a single file. Alternatively, there are atlas generating tools that will take a batch of image files and compile them into a texture atlas in just a couple of clicks.</p>
<p>I recommend using a Flash-based tool called <a href="http://zwoptex.zwopple.com/">Zwoptex</a> because it is officially supported by cocos2d.</p>
<p>Once you&#8217;re done, you should have an image that contains all of the frames of your animation such as the one below:</p>
<p><img src="http://getsetgames.com/wp-content/uploads/2010/04/grossini_dance_atlas.png" alt="Grossini Dance" title="Grossini Dance" width="512" height="512" class="aligncenter size-full wp-image-1399" /><br />
Incidentally, this image is included in the <a href="http://www.cocos2d-iphone.org/download">cocos2d distribution</a>.</p>
<h3>2. Create a CCSpriteSheet</h3>
<p>Once we have the texture atlas, it is time to get coding. The following code would go in the init method of a CCScene sub-class.</p>
<p>The first step in code is to create an instance of a CCSpriteSheet using your texture atlas and child it to a node in the scene. In this case we are childing it to the CCScene itself.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">CCSpriteSheet <span style="color: #002200;">*</span>danceSheet <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCSpriteSheet spriteSheetWithFile<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;grossini_dance_atlas.png&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>self addChild<span style="color: #002200;">:</span>danceSheet<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h3>3. Create a CCSprite Using Your CCSpriteSheet</h3>
<p>Next we create a CCSprite that uses the texture of the CCSpriteSheet that we just created. We then child it to the CCSpriteSheet. The rect that we initialize the CCSprite with is the first frame of the animation.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">CCSprite <span style="color: #002200;">*</span>danceSprite <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCSprite spriteWithTexture<span style="color: #002200;">:</span>danceSheet.texture rect<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">85</span>, <span style="color: #2400d9;">121</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>danceSheet addChild<span style="color: #002200;">:</span>danceSprite<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h3>4. Create a CCAnimation</h3>
<p>Next we need to create a CCAnimation instance and add all frames of the animation to it. In the case of this texture atlas, we know all of the frames are the same size and there are 14 of them, so we can use a nested loop to iterate through them all and break the loop when we finish adding frame #14.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">CCAnimation <span style="color: #002200;">*</span>danceAnimation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCAnimation animationWithName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;dance&quot;</span> delay<span style="color: #002200;">:</span>0.1f<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #a61390;">int</span> frameCount <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span> y <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>; y &lt; <span style="color: #2400d9;">3</span>; y<span style="color: #002200;">++</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span> x <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>; x &lt; <span style="color: #2400d9;">5</span>; x<span style="color: #002200;">++</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		CCSpriteFrame <span style="color: #002200;">*</span>frame <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCSpriteFrame frameWithTexture<span style="color: #002200;">:</span>danceSheet.texture rect<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span>x<span style="color: #002200;">*</span><span style="color: #2400d9;">85</span>,y<span style="color: #002200;">*</span><span style="color: #2400d9;">121</span>,<span style="color: #2400d9;">85</span>,<span style="color: #2400d9;">121</span><span style="color: #002200;">&#41;</span> offset<span style="color: #002200;">:</span>ccp<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>,<span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>danceAnimation addFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span>;
&nbsp;
		frameCount<span style="color: #002200;">++</span>;
&nbsp;
		<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>frameCount <span style="color: #002200;">==</span> <span style="color: #2400d9;">14</span><span style="color: #002200;">&#41;</span>
			<span style="color: #a61390;">break</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<h3>5. Run the CCAnimation on the CCSprite</h3>
<p>Finally, we need to create a CCAnimate action instance which we can run on the CCSprite. Below, we also wrap the CCAnimate action in a CCRepeatForever action that does what you would expect: repeats the animation&#8230; forever.</p>
<p>The last line actually plays the animation on the sprite using the runAction message.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">CCAnimate <span style="color: #002200;">*</span>danceAction <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCAnimate actionWithAnimation<span style="color: #002200;">:</span>danceAnimation<span style="color: #002200;">&#93;</span>;
CCRepeatForever <span style="color: #002200;">*</span>repeat <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCRepeatForever actionWithAction<span style="color: #002200;">:</span>danceAction<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>danceSprite runAction<span style="color: #002200;">:</span>repeat<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h3>Putting it All Together</h3>
<p>Here is what the above code looks like in a CCScene init method:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//</span>
<span style="color: #11740a; font-style: italic;">//  DanceScene.m</span>
<span style="color: #11740a; font-style: italic;">//  GrossiniDance</span>
<span style="color: #11740a; font-style: italic;">//</span>
&nbsp;
<span style="color: #6e371a;">#import &quot;DanceScene.h&quot;</span>
&nbsp;
&nbsp;
<span style="color: #a61390;">@implementation</span> DanceScene
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>init <span style="color: #002200;">&#123;</span>
	self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #11740a; font-style: italic;">// create the sprite sheet</span>
		CCSpriteSheet <span style="color: #002200;">*</span>danceSheet <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCSpriteSheet spriteSheetWithFile<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;grossini_dance_atlas.png&quot;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>self addChild<span style="color: #002200;">:</span>danceSheet<span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #11740a; font-style: italic;">// create the sprite</span>
		CCSprite <span style="color: #002200;">*</span>danceSprite <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCSprite spriteWithTexture<span style="color: #002200;">:</span>danceSheet.texture rect<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">85</span>, <span style="color: #2400d9;">121</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#91;</span>danceSheet addChild<span style="color: #002200;">:</span>danceSprite<span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #11740a; font-style: italic;">// position the sprite in the center of the screen</span>
		CGSize s <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>CCDirector sharedDirector<span style="color: #002200;">&#93;</span> winSize<span style="color: #002200;">&#93;</span>;
		danceSprite.position <span style="color: #002200;">=</span> ccp<span style="color: #002200;">&#40;</span>s.width<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span>,s.height<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span>;
&nbsp;
		<span style="color: #11740a; font-style: italic;">// create the animation</span>
		CCAnimation <span style="color: #002200;">*</span>danceAnimation <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCAnimation animationWithName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;dance&quot;</span> delay<span style="color: #002200;">:</span>0.1f<span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #a61390;">int</span> frameCount <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
		<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span> y <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>; y &lt; <span style="color: #2400d9;">3</span>; y<span style="color: #002200;">++</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
			<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">int</span> x <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>; x &lt; <span style="color: #2400d9;">5</span>; x<span style="color: #002200;">++</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
				CCSpriteFrame <span style="color: #002200;">*</span>frame <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCSpriteFrame frameWithTexture<span style="color: #002200;">:</span>danceSheet.texture rect<span style="color: #002200;">:</span>CGRectMake<span style="color: #002200;">&#40;</span>x<span style="color: #002200;">*</span><span style="color: #2400d9;">85</span>,y<span style="color: #002200;">*</span><span style="color: #2400d9;">121</span>,<span style="color: #2400d9;">85</span>,<span style="color: #2400d9;">121</span><span style="color: #002200;">&#41;</span> offset<span style="color: #002200;">:</span>ccp<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>,<span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
				<span style="color: #002200;">&#91;</span>danceAnimation addFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span>;
&nbsp;
				frameCount<span style="color: #002200;">++</span>;
&nbsp;
				<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>frameCount <span style="color: #002200;">==</span> <span style="color: #2400d9;">14</span><span style="color: #002200;">&#41;</span>
					<span style="color: #a61390;">break</span>;
			<span style="color: #002200;">&#125;</span>
		<span style="color: #002200;">&#125;</span>
&nbsp;
		<span style="color: #11740a; font-style: italic;">// create the action</span>
		CCAnimate <span style="color: #002200;">*</span>danceAction <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCAnimate actionWithAnimation<span style="color: #002200;">:</span>danceAnimation<span style="color: #002200;">&#93;</span>;
		CCRepeatForever <span style="color: #002200;">*</span>repeat <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CCRepeatForever actionWithAction<span style="color: #002200;">:</span>danceAction<span style="color: #002200;">&#93;</span>;
&nbsp;
		<span style="color: #11740a; font-style: italic;">// run the action</span>
		<span style="color: #002200;">&#91;</span>danceSprite runAction<span style="color: #002200;">:</span>repeat<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	<span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">@end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2010/04/18/how-to-animate-sprites-in-cocos2d/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
	
		<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/04/grossini_dance_atlas-150x150.png" />
		<media:content url="http://getsetgames.com/wp-content/uploads/2010/04/grossini_dance_atlas.png" medium="image">
			<media:title type="html">Grossini Dance</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/04/grossini_dance_atlas-150x150.png" />
		</media:content>
	</item>
		<item>
		<title>Addicus HD and Poptweets HD Running on the iPad &#8211; a Pictorial</title>
		<link>http://getsetgames.com/2010/04/05/addicus-hd-and-poptweets-hd-running-on-the-ipad-a-pictorial/</link>
		<comments>http://getsetgames.com/2010/04/05/addicus-hd-and-poptweets-hd-running-on-the-ipad-a-pictorial/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 16:25:57 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Addicus]]></category>
		<category><![CDATA[Addicus HD]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[Poptweets]]></category>
		<category><![CDATA[Poptweets HD]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1361</guid>
		<description><![CDATA[We had a terrific first weekend on the iPad store with both of our games ranking in the Top 100 in their categories. Thanks so much to everyone for playing! We also managed to get our hands on an actual iPad, despite being a Canada-based shop. After getting to test Addicus HD on the iPad, [...]]]></description>
			<content:encoded><![CDATA[<p>We had a terrific first weekend on the iPad store with both of our games ranking in the Top 100 in their categories. Thanks so much to everyone for playing!</p>
<p>We also managed to get our hands on an actual iPad, despite being a Canada-based shop. After getting to test <a href="http://getsetgames.com/games/addicus-hd/">Addicus HD</a> on the iPad, we have already submitted an update to fix a couple of issues. Look for that and also an update to <a href="http://getsetgames.com/games/poptweets-hd/">Poptweets HD</a> coming soon. </p>
<p>Here are some photos of the games running in all their glory:</p>
<p><center><br />
<a href="http://www.flickr.com/photos/dvanvliet/4493319101/" title="Addicus HD Running on the iPad - Title Screen by dvanvliet, on Flickr"><img src="http://farm3.static.flickr.com/2791/4493319101_cab28dda4a.jpg" width="500" height="333" alt="Addicus HD Running on the iPad - Title Screen" /></a></p>
<p><a href="http://www.flickr.com/photos/dvanvliet/4493321225/" title="Addicus HD Running on the iPad - Game Screen by dvanvliet, on Flickr"><img src="http://farm3.static.flickr.com/2748/4493321225_ba65afe3d6.jpg" width="500" height="333" alt="Addicus HD Running on the iPad - Game Screen" /></a></p>
<p><a href="http://www.flickr.com/photos/dvanvliet/4493960992/" title="Poptweets HD Running on the iPad - Title Screen by dvanvliet, on Flickr"><img src="http://farm5.static.flickr.com/4057/4493960992_2169d98da1.jpg" width="333" height="500" alt="Poptweets HD Running on the iPad - Title Screen" /></a></p>
<p><a href="http://www.flickr.com/photos/dvanvliet/4493324879/" title="Poptweets HD Running on the iPad - Game Screen by dvanvliet, on Flickr"><img src="http://farm3.static.flickr.com/2755/4493324879_ff77d3d648.jpg" width="333" height="500" alt="Poptweets HD Running on the iPad - Game Screen" /></a><br />
</center> </p>
]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2010/04/05/addicus-hd-and-poptweets-hd-running-on-the-ipad-a-pictorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://farm3.static.flickr.com/2791/4493319101_cab28dda4a.jpg" />
		<media:content url="http://farm3.static.flickr.com/2791/4493319101_cab28dda4a.jpg" medium="image">
			<media:title type="html">Addicus HD Running on the iPad - Title Screen</media:title>
		</media:content>
		<media:content url="http://farm3.static.flickr.com/2748/4493321225_ba65afe3d6.jpg" medium="image">
			<media:title type="html">Addicus HD Running on the iPad - Game Screen</media:title>
		</media:content>
		<media:content url="http://farm5.static.flickr.com/4057/4493960992_2169d98da1.jpg" medium="image">
			<media:title type="html">Poptweets HD Running on the iPad - Title Screen</media:title>
		</media:content>
		<media:content url="http://farm3.static.flickr.com/2755/4493324879_ff77d3d648.jpg" medium="image">
			<media:title type="html">Poptweets HD Running on the iPad - Game Screen</media:title>
		</media:content>
	</item>
		<item>
		<title>Poptweets &#8211; A first look at our Twitter-driven iPhone game!</title>
		<link>http://getsetgames.com/2010/02/05/poptweets-a-first-look-at-our-twitter-driven-iphone-game/</link>
		<comments>http://getsetgames.com/2010/02/05/poptweets-a-first-look-at-our-twitter-driven-iphone-game/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 22:00:54 +0000</pubDate>
		<dc:creator>Matt Coombe</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Poptweets]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1126</guid>
		<description><![CDATA[We&#8217;ve been hard at work on our next game for the iPhone and iPod touch and we&#8217;d like to share a few screenshots with you. Poptweets is an awesome trivia game that draws all its content from many of your favorite celebrities and personalities. All content in the game comes directly from a social network [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve been hard at work on our next game for the iPhone and iPod touch and we&#8217;d like to share a few screenshots with you. Poptweets is an awesome trivia game that draws all its content from many of your favorite celebrities and personalities. All content in the game comes directly from a social network you may have heard of &#8211; Twitter!</p>
<p>Poptweets is near completion and we&#8217;ll have plenty more information on it over the next few days!</p>
<p style="text-align: center;"><a href="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0443.png"><img class="size-full wp-image-1127 aligncenter" title="Poptweets - Get Set Games" src="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0443.png" alt="Poptweets - Get Set Games" width="320" height="480" /></a></p>
<p style="text-align: center;"><a href="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0443.png"></a><a href="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0444.png"><img class="size-full wp-image-1128 aligncenter" title="Poptweets - Get Set Games" src="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0444.png" alt="Poptweets - Get Set Games" width="320" height="480" /></a></p>
<p style="text-align: center;"><a href="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets011.jpg"><img class="aligncenter size-full wp-image-1143" title="PopTweets01 - Get Set Games" src="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets011.jpg" alt="" width="320" height="430" /></a></p>
<p style="text-align: center;"><a href="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets02.jpg"><img class="aligncenter size-full wp-image-1144" title="PopTweets02 - Get Set Games" src="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets02.jpg" alt="" width="320" height="430" /></a></p>
<p style="text-align: center;"><a href="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets03.jpg"><img class="aligncenter size-full wp-image-1145" title="PopTweets03 - Get Set Games" src="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets03.jpg" alt="" width="320" height="430" /></a></p>
<p style="text-align: center;"><a href="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets04.jpg"><img class="aligncenter size-full wp-image-1146" title="PopTweets04" src="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets04.jpg" alt="" width="320" height="430" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2010/02/05/poptweets-a-first-look-at-our-twitter-driven-iphone-game/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0443-150x150.png" />
		<media:content url="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0443.png" medium="image">
			<media:title type="html">Poptweets &#8211; Get Set Games</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0443-150x150.png" />
		</media:content>
		<media:content url="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0444.png" medium="image">
			<media:title type="html">Poptweets &#8211; Get Set Games</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/02/IMG_0444-150x150.png" />
		</media:content>
		<media:content url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets011.jpg" medium="image">
			<media:title type="html">PopTweets01 &#8211; Get Set Games</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets011-150x150.jpg" />
		</media:content>
		<media:content url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets02.jpg" medium="image">
			<media:title type="html">PopTweets02 &#8211; Get Set Games</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets02-150x150.jpg" />
		</media:content>
		<media:content url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets03.jpg" medium="image">
			<media:title type="html">PopTweets03 &#8211; Get Set Games</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets03-150x150.jpg" />
		</media:content>
		<media:content url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets04.jpg" medium="image">
			<media:title type="html">PopTweets04</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2010/02/PopTweets04-150x150.jpg" />
		</media:content>
	</item>
		<item>
		<title>iPhone Development Advent Tips Recap</title>
		<link>http://getsetgames.com/2009/12/26/iphone-development-advent-tips-recap/</link>
		<comments>http://getsetgames.com/2009/12/26/iphone-development-advent-tips-recap/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 19:44:00 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[advent]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=868</guid>
		<description><![CDATA[Below is a recap of all of the iPhone app development tips we posted in the month of December advent-style. We hope this serves as a one-stop shop for many aspects of iPhone development that are commonly encountered. 1. How to Open a URL in Safari 2. How to Show an Alert with UIAlertView 3. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://getsetgames.com/wp-content/uploads/2009/12/Screen-shot-2009-12-26-at-2.39.49-PM.png" alt="" title="Screen shot 2009-12-26 at 2.39.49 PM" width="150" class="alignright size-full wp-image-1087" />Below is a recap of all of the iPhone app development tips we posted in the month of December advent-style. We hope this serves as a one-stop shop for many aspects of iPhone development that are commonly encountered. </p>
<p>1. <a href="http://getsetgames.com/2009/12/01/iphonedev-advent-tip-1-how-to-open-a-url-in-safari/">How to Open a URL in Safari</a><br />
2. <a href="http://getsetgames.com/2009/12/02/iphonedev-advent-tip-2-how-to-show-an-alert-with-uialertview/">How to Show an Alert with UIAlertView</a><br />
3. <a href="http://getsetgames.com/2009/12/03/iphonedev-advent-tip-3-how-to-display-an-activity-indicator-with-uiactivityindicatorview/">How to Display an Activity Indicator with UIActivityIndicatorView</a><br />
4. <a href="http://getsetgames.com/2009/12/04/iphonedev-advent-tip-4-eliminating-class-dependencies-on-your-application-delegate/">Eliminating class dependencies on your app delegate</a><br />
5. <a href="http://getsetgames.com/2009/12/05/iphonedev-advent-tip-5-how-to-load-a-uiimage-from-a-url/">How to Load a UIImage From a URL</a><br />
6. <a href="http://getsetgames.com/2009/12/06/iphonedev-advent-tip-6-how-to-open-the-mail-app-with-a-pre-composed-html-email/">How to Open the Mail App With a Pre-Composed HTML Email</a><br />
7. <a href="http://getsetgames.com/2009/12/07/iphonedev-advent-tip-7-how-to-get-the-current-time-with-nsdate/">How to Get the Current Time With NSDate</a><br />
8. <a href="http://getsetgames.com/2009/12/08/iphonedev-advent-tip-8-how-to-get-the-platform-name/">How to Get the Platform Name</a><br />
9. <a href="http://getsetgames.com/2009/12/09/iphonedev-advent-tip-9-how-to-set-your-apps-splash-screen/">How to Set Your App&#8217;s Splash Screen</a><br />
10. <a href="http://getsetgames.com/2009/12/10/iphonedev-advent-tip-10-string-comparison-using-nsstring/">String Comparison Using NSString</a><br />
11. <a href="http://getsetgames.com/2009/12/11/iphonedev-advent-tip-11-how-to-hide-and-show-the-status-bar/">How to Hide (and Show) the Status Bar</a><br />
12. <a href="http://getsetgames.com/2009/12/12/iphonedev-advent-tip-12-how-to-dial-a-phone-number/">How to Dial a Phone Number</a><br />
13. <a href="http://getsetgames.com/2009/12/13/iphonedev-advent-tip-13-how-to-get-your-apps-display-name-and-version/">How to Get Your App&#8217;s Display Name and Version</a><br />
14. <a href="http://getsetgames.com/2009/12/14/iphonedev-advent-tip-14-how-to-retrieve-your-app-delegate-singleton-instance/">How to Retrieve Your App Delegate Singleton Instance</a><br />
15. <a href="http://getsetgames.com/2009/12/15/iphonedev-advent-tip-15-how-to-make-the-iphone-vibrate/">How to Make the iPhone Vibrate</a><br />
16. <a href="http://getsetgames.com/2009/12/16/iphonedev-advent-tip-16-how-to-show-the-network-activity-indicator/">How to Show the Network Activity Indicator</a><br />
17. <a href="http://getsetgames.com/2009/12/17/iphonedev-advent-tip-17-how-to-prevent-the-iphone-from-sleeping/">How to Prevent the iPhone From Sleeping</a><br />
18. <a href="http://getsetgames.com/2009/12/18/iphonedev-advent-tip-18-how-to-take-the-shine-off-your-apps-icon/">How to Take the Shine off Your App&#8217;s Icon</a><br />
19. <a href="http://getsetgames.com/2009/12/19/iphonedev-advent-tip-19-how-to-format-an-nsstring/">How to Format an NSString</a><br />
20. <a href="http://getsetgames.com/2009/12/20/iphonedev-advent-tip-20-how-to-play-a-video-with-mpmovieplayercontroller/">How to Play a Video With MPMoviePlayerController</a><br />
21. <a href="http://getsetgames.com/2009/12/21/iphonedev-advent-tip-21-how-to-upgrade-your-iphone-game-to-openfeint-2-4/">How to Upgrade Your iPhone Game to OpenFeint 2.4</a><br />
22. <a href="http://getsetgames.com/2009/12/22/iphonedev-advent-tip-22-how-to-log-to-the-console-using-nslog/">How to Log to the Console Using NSLog</a><br />
23. <a href="http://getsetgames.com/2009/12/23/iphonedev-advent-tip-23-how-to-suspend-touch-input/">How to Suspend Touch Input</a><br />
24. <a href="http://getsetgames.com/2009/12/24/iphonedev-advent-tip-24-how-to-open-the-sms-app-with-a-phone-number/">How to Open the SMS App With a Phone Number</a></p>
]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2009/12/26/iphone-development-advent-tips-recap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2009/12/Screen-shot-2009-12-26-at-2.39.49-PM-150x150.png" />
		<media:content url="http://getsetgames.com/wp-content/uploads/2009/12/Screen-shot-2009-12-26-at-2.39.49-PM.png" medium="image">
			<media:title type="html">Screen shot 2009-12-26 at 2.39.49 PM</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2009/12/Screen-shot-2009-12-26-at-2.39.49-PM-150x150.png" />
		</media:content>
	</item>
		<item>
		<title>How to Open the SMS App With a Phone Number</title>
		<link>http://getsetgames.com/2009/12/24/iphonedev-advent-tip-24-how-to-open-the-sms-app-with-a-phone-number/</link>
		<comments>http://getsetgames.com/2009/12/24/iphonedev-advent-tip-24-how-to-open-the-sms-app-with-a-phone-number/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 19:49:49 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[UIApplication]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1073</guid>
		<description><![CDATA[It&#8217;s the day before Christmas, so this is the last post in our advent tip series. We&#8217;ve really enjoyed writing about so many little things that are so easily accomplished with the iPhone SDK and we hope that they&#8217;ve helped you in developing your iPhone apps. This may be the last blog post in this [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the day before Christmas, so this is the last post in our <a href="http://getsetgames.com/tag/advent/">advent tip series</a>. We&#8217;ve really enjoyed writing about so many little things that are so easily accomplished with the iPhone SDK and we hope that they&#8217;ve helped you in developing your iPhone apps. This may be the last blog post in this series, but you can be sure we&#8217;ll still be writing about our adventures with iPhone, cocos2d and OpenFeint development.</p>
<h2>Less Yap, More Tip</h2>
<p><img src="http://getsetgames.com/wp-content/uploads/2009/12/messages.png" alt="" title="messages" width="69" height="85" class="alignright size-full wp-image-1074" />Today&#8217;s advent tip is how to open the Messages app (aka the SMS app) with a specific phone number populated in the <strong>To:</strong> field. This is accomplished with great ease because the iPhone has implemented the <strong>sms:</strong> URI scheme. Therefore, we can use the UIApplication class&#8217; openURL method, which we have seen before when we discussed how to <a href="http://getsetgames.com/2009/12/12/iphonedev-advent-tip-12-how-to-dial-a-phone-number/">dial a phone number</a>, <a href="http://getsetgames.com/2009/12/06/iphonedev-advent-tip-6-how-to-open-the-mail-app-with-a-pre-composed-html-email/">pre-compose an email</a>, and yes, even <a href="http://getsetgames.com/2009/12/01/iphonedev-advent-tip-1-how-to-open-a-url-in-safari/">open a URL</a>.</p>
<p>So here it is: the one line of code you need to pop open the SMS app with a phone number:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> openURL<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;sms:5555555555&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2009/12/24/iphonedev-advent-tip-24-how-to-open-the-sms-app-with-a-phone-number/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2009/12/messages.png" />
		<media:content url="http://getsetgames.com/wp-content/uploads/2009/12/messages.png" medium="image">
			<media:title type="html">messages</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Suspend Touch Input</title>
		<link>http://getsetgames.com/2009/12/23/iphonedev-advent-tip-23-how-to-suspend-touch-input/</link>
		<comments>http://getsetgames.com/2009/12/23/iphonedev-advent-tip-23-how-to-suspend-touch-input/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 00:06:43 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[UIApplication]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1069</guid>
		<description><![CDATA[Have you ever encountered a situation where you wish you could just pause and resume touch input while developing an iPhone app? Sure, you could always increase the complexity of your input handling by considering the state of any number of variables, but there are some times when just switching input off and on would [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever encountered a situation where you wish you could just pause and resume touch input while developing an iPhone app? Sure, you could always increase the complexity of your input handling by considering the state of any number of variables, but there are some times when just switching input off and on would be easiest.</p>
<p>We had a number of cases like this when developing <a href="http://getsetgames.com/games/addicus/">Addicus</a>. In particular, because we have both the game and game over screens operating in a single cocos2d scene, we were noticing some bugs that occurred because of the way we handled input. This was solved by suspending input for brief periods of time.</p>
<h2>Input Goes Off</h2>
<p>Here&#8217;s how to tell your iPhone app to stop responding to touch events in just one line of code:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> beginIgnoringInteractionEvents<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h2>Input Goes On</h2>
<p>And as you might expect, resuming responding to touch input events is similarly easy:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> endIgnoringInteractionEvents<span style="color: #002200;">&#93;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2009/12/23/iphonedev-advent-tip-23-how-to-suspend-touch-input/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>How to Log to the Console Using NSLog</title>
		<link>http://getsetgames.com/2009/12/22/iphonedev-advent-tip-22-how-to-log-to-the-console-using-nslog/</link>
		<comments>http://getsetgames.com/2009/12/22/iphonedev-advent-tip-22-how-to-log-to-the-console-using-nslog/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 23:56:19 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[NSLog]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1056</guid>
		<description><![CDATA[Xcode has a built in console that provides an invaluable debugging tool for iPhone app development. It gives you a way to monitor text output from your app live at runtime. It works both for apps being debugged in the simulator and on a device. NSLog Logging statements to the console is just as easy [...]]]></description>
			<content:encoded><![CDATA[<p>Xcode has a built in console that provides an invaluable debugging tool for iPhone app development. It gives you a way to monitor text output from your app live at runtime. It works both for apps being debugged in the simulator and on a device.</p>
<h2>NSLog</h2>
<p>Logging statements to the console is just as easy as you would expect it to be in iPhone app development. Just run the NSLog function like so:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;hello world&quot;</span><span style="color: #002200;">&#41;</span>;</pre></div></div>

<h2>Format Specifiers</h2>
<p>The NSLog statement also supports <a href="http://getsetgames.com/2009/12/19/iphonedev-advent-tip-19-how-to-format-an-nsstring/">string formatting specifiers</a>, so you can also output the values of variables to the console with just one line. Below are some examples:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span> str <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;hello world&quot;</span>;
NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%@&quot;</span>, str<span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #a61390;">int</span> num <span style="color: #002200;">=</span> <span style="color: #2400d9;">10</span>;
NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%i&quot;</span>, num<span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #a61390;">float</span> price <span style="color: #002200;">=</span> <span style="color: #2400d9;">1.99</span>;
NSLog<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%f&quot;</span>, price<span style="color: #002200;">&#41;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2009/12/22/iphonedev-advent-tip-22-how-to-log-to-the-console-using-nslog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
	</item>
		<item>
		<title>How to Upgrade Your iPhone Game to OpenFeint 2.4</title>
		<link>http://getsetgames.com/2009/12/21/iphonedev-advent-tip-21-how-to-upgrade-your-iphone-game-to-openfeint-2-4/</link>
		<comments>http://getsetgames.com/2009/12/21/iphonedev-advent-tip-21-how-to-upgrade-your-iphone-game-to-openfeint-2-4/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:40:28 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[openfeint]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1018</guid>
		<description><![CDATA[If you were watching twitter this week, you might have heard that OpenFeint 2.4 was quietly released to developers. This update surely stretches the definition of &#8220;point release&#8221; because it is packed with awesome new features as well as a complete overhaul of the interface. If you are upgrading to OpenFeint 2.4 from a previous [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://getsetgames.com/wp-content/uploads/2009/12/of_logo.png" alt="" title="of_logo" width="232" height="61" class="alignright size-full wp-image-1043" />If you were watching twitter this week, you might have heard that <a href="http://www.openfeint.com">OpenFeint 2.4</a> was <a href="http://twitter.com/openfeint/status/6806021596">quietly released</a> to developers. This update surely stretches the definition of &#8220;point release&#8221; because it is packed with awesome new features as well as a complete overhaul of the interface.</p>
<p>If you are upgrading to OpenFeint 2.4 from a previous version, then it is not as easy as replacing the source code. However, it is still quite easy to make the upgrade if you just keep a few things in mind. Here&#8217;s what you need to know:</p>
<h2>Disabling Chat</h2>
<p>If you were previously disabling the chat feature in order to meet a certain parental ratings requirement, then you would be doing so by passing the <strong>OpenFeintSettingDisableChat</strong> setting into the initializeWithProductKey method. Since chat is not the only user-genereated content in OpenFeint 2.4, this setting name has been changed to <strong>OpenFeintSettingDisableUserGeneratedContent</strong>. Below is the new way to initialize OpenFeint with chat (and all user-generated content) disabled:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSDictionary</span><span style="color: #002200;">*</span> settings <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDictionary</span> dictionaryWithObjectsAndKeys<span style="color: #002200;">:</span>
			<span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNumber</span> numberWithInt<span style="color: #002200;">:</span>UIInterfaceOrientationLandscapeRight<span style="color: #002200;">&#93;</span>, OpenFeintSettingDashboardOrientation,
			<span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Addicus&quot;</span>, OpenFeintSettingShortDisplayName,
			<span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNumber</span> numberWithBool<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>, OpenFeintSettingDisableUserGeneratedContent,
			<span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
OFDelegatesContainer<span style="color: #002200;">*</span> delegates <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>OFDelegatesContainer containerWithOpenFeintDelegate<span style="color: #002200;">:</span>self
								andChallengeDelegate<span style="color: #002200;">:</span>self
								andNotificationDelegate<span style="color: #002200;">:</span>self<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>OpenFeint initializeWithProductKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;MY_PRODUCT_KEY&quot;</span>
			andSecret<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;MY_PRODUCT_SECRET&quot;</span>
			andDisplayName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Addicus&quot;</span>
			andSettings<span style="color: #002200;">:</span>settings
			andDelegates<span style="color: #002200;">:</span>delegates<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h2>New Library Dependencies</h2>
<p><img src="http://getsetgames.com/wp-content/uploads/2009/12/Screen-shot-2009-12-21-at-10.22.40-AM-298x300.png" alt="" title="Screen shot 2009-12-21 at 10.22.40 AM" width="298" height="300" class="alignright size-medium wp-image-1039" />If you replaced OpenFeint 2.3.x in your project with the new 2.4 source, you might have gotten a bunch of nasty errors upon building it. This is because the OpenFeint 2.4 requires more libraries to be added to your target. You need to add the following 3 frameworks to your target to get your OpenFeint 2.4 game to build successfully:</p>
<ul>
<li>CFNetwork</li>
<li>CoreLocation</li>
<li>MapKit</li>
</ul>
<p><br/><br />
<br/></p>
<h2>Achievements and Social Networks</h2>
<p>In OpenFeint 2.4, unlocking an achievement no longer prompts the user to notify their friends on Twitter and Facebook by default. However, you can restore this behaviour by setting the <strong>OpenFeintSettingPromptToPostAchievementUnlock</strong> setting to be true at the time of initialization. Below is how to initialize OpenFeint 2.4 with prompts to post achievements to social networks enabled:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSDictionary</span><span style="color: #002200;">*</span> settings <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSDictionary</span> dictionaryWithObjectsAndKeys<span style="color: #002200;">:</span>
			<span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNumber</span> numberWithInt<span style="color: #002200;">:</span>UIInterfaceOrientationLandscapeRight<span style="color: #002200;">&#93;</span>, OpenFeintSettingDashboardOrientation,
			<span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Addicus&quot;</span>, OpenFeintSettingShortDisplayName,
			<span style="color: #002200;">&#91;</span><span style="color: #400080;">NSNumber</span> numberWithBool<span style="color: #002200;">:</span><span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>, OpenFeintSettingPromptToPostAchievementUnlock,
			<span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
OFDelegatesContainer<span style="color: #002200;">*</span> delegates <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>OFDelegatesContainer containerWithOpenFeintDelegate<span style="color: #002200;">:</span>self
								andChallengeDelegate<span style="color: #002200;">:</span>self
								andNotificationDelegate<span style="color: #002200;">:</span>self<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>OpenFeint initializeWithProductKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;MY_PRODUCT_KEY&quot;</span>
			andSecret<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;MY_PRODUCT_SECRET&quot;</span>
			andDisplayName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Addicus&quot;</span>
			andSettings<span style="color: #002200;">:</span>settings
			andDelegates<span style="color: #002200;">:</span>delegates<span style="color: #002200;">&#93;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2009/12/21/iphonedev-advent-tip-21-how-to-upgrade-your-iphone-game-to-openfeint-2-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2009/12/of_logo-150x61.png" />
		<media:content url="http://getsetgames.com/wp-content/uploads/2009/12/of_logo.png" medium="image">
			<media:title type="html">of_logo</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2009/12/of_logo-150x61.png" />
		</media:content>
		<media:content url="http://getsetgames.com/wp-content/uploads/2009/12/Screen-shot-2009-12-21-at-10.22.40-AM.png" medium="image">
			<media:title type="html">Screen shot 2009-12-21 at 10.22.40 AM</media:title>
			<media:thumbnail url="http://getsetgames.com/wp-content/uploads/2009/12/Screen-shot-2009-12-21-at-10.22.40-AM-150x150.png" />
		</media:content>
	</item>
		<item>
		<title>How to Play a Video With MPMoviePlayerController</title>
		<link>http://getsetgames.com/2009/12/20/iphonedev-advent-tip-20-how-to-play-a-video-with-mpmovieplayercontroller/</link>
		<comments>http://getsetgames.com/2009/12/20/iphonedev-advent-tip-20-how-to-play-a-video-with-mpmovieplayercontroller/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 21:27:32 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[MPMoviePlayerController]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1022</guid>
		<description><![CDATA[Splash screens, cutscenes, tutorials or just good old content. There are plenty of reasons to need to play a video in your iPhone app. Here&#8217;s how to do it in 3 simple steps: 1. Add the MediaPlayer framework to your target. 2. Import the MediaPlayer header file in the file you intend to begin playing [...]]]></description>
			<content:encoded><![CDATA[<p>Splash screens, cutscenes, tutorials or just good old content. There are plenty of reasons to need to play a video in your iPhone app. Here&#8217;s how to do it in 3 simple steps:</p>
<p>1. Add the MediaPlayer framework to your target.</p>
<p>2. Import the MediaPlayer header file in the file you intend to begin playing the video in, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &lt;MediaPlayer/MediaPlayer.h&gt;</span></pre></div></div>

<p>3a. Now we can stream a video from the internet like so:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>url <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;http://www.example.com/myvideo.m4v&quot;</span><span style="color: #002200;">&#93;</span>;
MPMoviePlayerController <span style="color: #002200;">*</span>player <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MPMoviePlayerController alloc<span style="color: #002200;">&#93;</span> initWithContentURL<span style="color: #002200;">:</span>url<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>player play<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>3b. Alternately, we can stream a video that you include in your app bundle. To stream a file called <em>myvideo.m4v</em>, you would run the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>path <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span> pathForResource<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;myvideo&quot;</span> ofType<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;m4v&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>url <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> fileURLWithPath<span style="color: #002200;">:</span>path<span style="color: #002200;">&#93;</span>;
&nbsp;
MPMoviePlayerController <span style="color: #002200;">*</span>player <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MPMoviePlayerController alloc<span style="color: #002200;">&#93;</span> initWithContentURL<span style="color: #002200;">:</span>url<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>player play<span style="color: #002200;">&#93;</span>;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2009/12/20/iphonedev-advent-tip-20-how-to-play-a-video-with-mpmovieplayercontroller/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
	</item>
		<item>
		<title>How to Format an NSString</title>
		<link>http://getsetgames.com/2009/12/19/iphonedev-advent-tip-19-how-to-format-an-nsstring/</link>
		<comments>http://getsetgames.com/2009/12/19/iphonedev-advent-tip-19-how-to-format-an-nsstring/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 03:08:02 +0000</pubDate>
		<dc:creator>Derek van Vliet</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[NSString]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://getsetgames.com/?p=1010</guid>
		<description><![CDATA[It&#8217;s back to basics with today&#8217;s advent tip. I would be surprised if anything short of ALL developers have had a need to format strings at one time or another. iPhone app development is no exception. String formatting allows you to build a string based on a template and varying types of values. For example, [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s back to basics with today&#8217;s advent tip. I would be surprised if anything short of ALL developers have had a need to format strings at one time or another. iPhone app development is no exception.</p>
<p>String formatting allows you to build a string based on a template and varying types of values. For example, if I am keeping track of a player&#8217;s score as an integer and I want to display a string to the player that celebrates their score by saying &#8220;You scored 2600! Way to go!&#8221;, then I need string formatting to get the correct score in the middle of that string.</p>
<h2>How to Do It</h2>
<p>Below is an example of how to build the above NSString. This example formats a string with an integer in it using the <strong>%i</strong> format specifier.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #a61390;">int</span> score <span style="color: #002200;">=</span> <span style="color: #2400d9;">2600</span>;
<span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span> scoreString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;You scored %i! Way to go!&quot;</span>,score<span style="color: #002200;">&#93;</span>;</pre></div></div>

<h2>Format Specifiers</h2>
<p>But string formatting doesn&#8217;t stop at putting integers in strings. Below are some of the most common format specifiers for other value types:</p>
<table>
<tr>
<td><strong>Specifier</strong></td>
<td><strong>Purpose</strong></td>
</tr>
<tr>
<td>%i</td>
<td>integer</td>
</tr>
<tr>
<td>%f</td>
<td>float</td>
</tr>
<tr>
<td>%@</td>
<td>Objective-C object (commonly used to specify another NSString)</td>
</tr>
<tr>
<td>%x</td>
<td>hexadecimal</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://getsetgames.com/2009/12/19/iphonedev-advent-tip-19-how-to-format-an-nsstring/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
	</item>
	</channel>
</rss>
