<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.8.3 (http://www.squarespace.com/) on Tue, 01 Dec 2009 06:41:08 GMT--><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><title>If (...) then {...}</title><subtitle>Blog</subtitle><id>http://fraggle.squarespace.com/blog/</id><link rel="alternate" type="application/xhtml+xml" href="http://fraggle.squarespace.com/blog/"/><link rel="self" type="application/atom+xml" href="http://fraggle.squarespace.com/blog/atom.xml"/><updated>2009-10-27T11:17:52Z</updated><generator uri="http://www.squarespace.com/" version="Squarespace Site Server v5.8.3 (http://www.squarespace.com/)">Squarespace</generator><entry><title>IE suck... again :)</title><category term="ie"/><category term="killbill"/><category term="suck"/><id>http://fraggle.squarespace.com/blog/2009/10/27/ie-suck-again.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/10/27/ie-suck-again.html"/><author><name>Fraggle</name></author><published>2009-10-27T11:09:09Z</published><updated>2009-10-27T11:09:09Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>Do you know why this code fails in IE (no matter which version: 6, 7, 8):</p>
<blockquote>
<p>&lt;script&gt; window.open(url, 'window-' + Math.rand(), 'menubars=no, toolbar=no'); &lt;/script&gt;</p>
</blockquote>
<p>Well...</p>
<p>Because you can't use a dash (-) in a window name stupid (and neither can you use a dot (.)) ! :)</p>
<p>Fwi, the w3c state that a window name is a DOMString, and the definition of DOMString is <a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-C74D1578">http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-C74D1578</a> where dashes and dots are allowed..</p>]]></content></entry><entry><title>After 14 months of work</title><category term="!vaporware"/><category term="iphone, obj-c &amp; cocoa"/><category term="jesus"/><category term="second coming"/><id>http://fraggle.squarespace.com/blog/2009/10/19/after-14-months-of-work.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/10/19/after-14-months-of-work.html"/><author><name>Fraggle</name></author><published>2009-10-19T12:11:15Z</published><updated>2009-10-19T12:11:15Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>The day that we all though would never come... came!</p>
<p><span class="full-image-block ssNonEditable"><span><img src="http://img.skitch.com/20091019-b7d72gt55ig99w7321hyc8rr5u.jpg?__SQUARESPACE_CACHEVERSION=1255954327851" alt="" /></span></span></p>
<p>Wish me good luck with the review process :)</p>
<p>And soon, I'll resume writing usefuls posts.</p>
<p>ps: the game will be free so check it out when it's out and let me know if you have any questions.</p>]]></content></entry><entry><title>Almost done.. here is Urban Rivals iphone trailer</title><category term="iphone"/><category term="iphone, obj-c &amp; cocoa"/><id>http://fraggle.squarespace.com/blog/2009/9/15/almost-done-here-is-urban-rivals-iphone-trailer.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/9/15/almost-done-here-is-urban-rivals-iphone-trailer.html"/><author><name>Fraggle</name></author><published>2009-09-15T08:45:16Z</published><updated>2009-09-15T08:45:16Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/6ijPg7mlESU&hl=fr&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/6ijPg7mlESU&hl=fr&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>This is the game I have been working on for more than a year now.</p>]]></content></entry><entry><title>Quick suggestions: ps3 &amp; iphones games</title><category term="e3"/><category term="games"/><category term="games"/><category term="geocaching"/><category term="infamous"/><category term="iphone"/><category term="peegle"/><category term="ps3"/><category term="real racing"/><category term="uncharted"/><id>http://fraggle.squarespace.com/blog/2009/7/12/quick-suggestions-ps3-iphones-games.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/7/12/quick-suggestions-ps3-iphones-games.html"/><author><name>Fraggle</name></author><published>2009-07-12T10:47:30Z</published><updated>2009-07-12T10:47:30Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>As a recent Dad, I'm quite busy but here are some quick suggestions of things to try / look at if you are curious:</p>
<p>On my PS3, I recently finished Infamous and Uncharted, both of them are great games.</p>
<p><span class="thumbnail-image-float-left ssNonEditable"><span><a href="javascript:showFullImage('/display/ShowImage?imageUrl=%2Fstorage%2Fpost-images%2F48753_Infamous-Screenshot-04_normal.jpg%3F__SQUARESPACE_CACHEVERSION%3D1247396685426',416,740);"><img src="http://fraggle.squarespace.com/storage/thumbnails/3785318-3569117-thumbnail.jpg?__SQUARESPACE_CACHEVERSION=1247396689322" alt="" /></a></span></span><a href="http://www.infamousthegame.com/">Infamous</a>&nbsp;is very fun, somewhat repetitive (I really would have loved to see more differents enemies) but the story keeps pushing you forward and the control system is very well done so it's very easy to jump and run and fly and drift etc.. Not a "cult game" but you wont be disappointed if you're looking for fun. I would like to give a special mention to the cutscene rendered in a animated comic style, I really dig their style!</p>
<p>&nbsp;</p>
<p><span class="full-image-float-left ssNonEditable"><span><a href="javascript:showFullImage('/display/ShowImage?imageUrl=%2Fstorage%2Fthumbnails%2F3785318-3569121-thumbnail.jpg%3F__SQUARESPACE_CACHEVERSION%3D1247396741420',84,150);"><img src="http://fraggle.squarespace.com/storage/thumbnails/3785318-3569122-thumbnail.jpg?__SQUARESPACE_CACHEVERSION=1247396741421" alt="" /></a></span></span></p>
<p><a href="http://www.us.playstation.com/uncharted/">Uncharted: Drake's fortune</a>&nbsp;has been on my radar since it's release as a line-up title for the PS3 but for some reason I never convinced myself to get it. Fortunatly, it's now a "platinium" game. At 20&euro;, it was a easy decision so I picked it up and I'm really glad I did. It's one of the best game I played on my PS3: it's fun, it's actiony AND plateformy. Sort of a Tomb Raider done right. The graphics are gorgeous, the story telling is fantastic, the controls are top notch and the music is awesome. Am I using too many superlatives ? Yes, maybe, honestly, each part of the gameplay has been done in a better way in another game but they are always <em>at least</em> good. The sum of all thoses parts makes a fantastic game that you'll play to the end and then, like me, wait for the sequel. Have you seen the&nbsp;<a href="http://www.youtube.com/watch?v=3Ok9Nd5RMLk">gameplay</a>&nbsp;and&nbsp;<a href="http://www.youtube.com/watch?v=GUPAyGWKd6c">trailer</a>&nbsp;videos from E3 ?! WOAW!.</p>
<p>I also got&nbsp;<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=314303518&amp;mt=8">Peegle</a>&nbsp;and&nbsp;<a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=318366258&amp;mt=8">Real Racing</a>&nbsp;for my iPhone. They are both amazing in their respectives styles. I wont go into the details of Peegle as it is now a classic from the hit-makers PopCap. But I will discuss Real Racing a little bit more. The first thing you'll notice is how impressive it is: smooth and so polished it raise the bar for everyone of us, iphone game developpers. I also really like the wait they do multiplayer with a nice blend of async and sync gameplay: you join a short lived "league" with other players, but you compete by doing time trial in the allowed time for each race while your challengers do the same (I like the "fast" league with 3x 10 mins races). Then you earn CR points to climb the worldwide ranking. Here is <a href="http://realracing.cloudcell.com/Driver.php?nId=73676">my profile</a>&nbsp;on their cloudcell service, if you are playing the game, add me to your friends so we can compare our performances :)</p>
<p><span class="thumbnail-image-float-left ssNonEditable"><span><a href="javascript:showFullImage('/display/ShowImage?imageUrl=%2Fstorage%2Fpost-images%2F314303518screen.jpg%3F__SQUARESPACE_CACHEVERSION%3D1247396780137',320,480);"><img src="http://fraggle.squarespace.com/storage/thumbnails/3785318-3569124-thumbnail.jpg?__SQUARESPACE_CACHEVERSION=1247396780138" alt="" /></a></span></span><span class="thumbnail-image-float-right ssNonEditable"><span><a href="javascript:showFullImage('/display/ShowImage?imageUrl=%2Fstorage%2Fpost-images%2Fimg_011.png%3F__SQUARESPACE_CACHEVERSION%3D1247396812329',320,480);"><img src="http://fraggle.squarespace.com/storage/thumbnails/3785318-3569126-thumbnail.jpg?__SQUARESPACE_CACHEVERSION=1247396812330" alt="" /></a></span></span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Speaking of iphone games,&nbsp;<a href="http://www.slidetoplay.com/">SlideToPlay</a>&nbsp;was nice enough to do a preview of my game:&nbsp;<a href="http://www.urban-rivals.com">Urban Rivals</a>,&nbsp;<a href="http://www.slidetoplay.com/story/urban-rivals-preview">check it out</a>!</p>
<p>Finally, I'm getting totally hooked into <a href="http://www.geocaching.com">GeoCaching</a>&nbsp;(thanks to the <a href="http://www.totallyradshow.com/">Totally Rad Show</a> for pointing me to this great hobby), if you dont know what it is: think worldwide modern treasure hunt with iphone and/or GPS. You MUST take a look and there is even an <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=292242503&amp;mt=8">iphone application</a> to ease the process (but not the hunt) :)</p>]]></content></entry><entry><title>@property &amp; @synthesize behavior I couldn't have guessed</title><category term="gotcha"/><category term="iphone"/><category term="iphone, obj-c &amp; cocoa"/><id>http://fraggle.squarespace.com/blog/2009/7/6/property-synthesize-behavior-i-couldnt-have-guessed.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/7/6/property-synthesize-behavior-i-couldnt-have-guessed.html"/><author><name>Fraggle</name></author><published>2009-07-06T06:45:16Z</published><updated>2009-07-06T06:45:16Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>As I was investing a unexpected crash related to object release/retain, I had to fire up "Instruments" to understand what was happening..</p>
<p>After a few hours of investigation, I finally found that the code generated by @synthesize for getters is returning a new autoreleased ref to the property and not the property itself. I dont understand the reason yet, but I trust Apple to have a perfectly good explanation for doing this.</p>
<p>This was causing an issue in my code as I was doing [self.prop release] in my dealloc methods instead of [prop release] _all the time_. I also don't remember why I took this habit in my early obj-c days but it's a bad habit to have and it can cause very tricky bug to track down. So now you know :)</p>]]></content></entry><entry><title>Doing game using accelerometer on the iphone ? Dont miss that.</title><category term="accelerometer"/><category term="clever"/><category term="iphone, obj-c &amp; cocoa"/><category term="simulator"/><id>http://fraggle.squarespace.com/blog/2009/6/14/doing-game-using-accelerometer-on-the-iphone-dont-miss-that.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/6/14/doing-game-using-accelerometer-on-the-iphone-dont-miss-that.html"/><author><name>Fraggle</name></author><published>2009-06-14T12:12:57Z</published><updated>2009-06-14T12:12:57Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>I bookmarked it on delicious so it <span style="text-decoration: line-through;">should</span> is on the right side of the site but I figured it was worth a post as well.</p>
<p>I'm not using accelerometer in my game (still in dev.. dont have much time, gonna have my first baby in a few days) but if I would, I can imagine the pain in the dev process of not having the possibility to tilt anything to test tilt-control. Always having to push it a build to the device can be painful (especially with a large game) can turn into a nightmare!</p>
<p>Someone very smart figured out a solution that I strongly urge Apple to refine and bundle with the official sdk: use a client software of the device that sends out accelerometer informations to a server in your app INSIDE the simulator. Verryyyyy clever indeed.</p>
<p>Apple could integrate it directly in the simulator app itself (no more need to bundle anything) and apply the tilt to the window (well... let's make it a 3D representation of an iphone) with full 3D effects in space, in real time.</p>
<p>Apple, if you read me, do that :)</p>
<p>Oops: I almost forgot the link to the blog I found it:&nbsp;<a href="http://www.bit-101.com/blog/?p=2176">Accelerometer in Simulator | BIT-101 Blog</a>&nbsp;and to the project itself:&nbsp;<a href="http://code.google.com/p/accelerometer-simulator/wiki/Home">http://code.google.com/p/accelerometer-simulator/wiki/Home</a></p>]]></content></entry><entry><title>iPhone SDK gotchas #2</title><category term="gotcha"/><category term="iphone, obj-c &amp; cocoa"/><category term="wifi"/><id>http://fraggle.squarespace.com/blog/2009/6/4/iphone-sdk-gotchas-2.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/6/4/iphone-sdk-gotchas-2.html"/><author><name>Fraggle</name></author><published>2009-06-04T17:16:25Z</published><updated>2009-06-04T17:16:25Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>I was wondering why the Wifi was systematically shut down after a while in my game (it's a multiplayer game).</p>
<p>Well, another "gotcha":&nbsp;<a href="http://stackoverflow.com/questions/761140/wifi-connection-is-dropped-after-user-inactivity-period">http://stackoverflow.com/questions/761140/wifi-connection-is-dropped-after-user-inactivity-period</a></p>
<p>Basically, you must set&nbsp;<strong>UIRequiresPersistentWiFi</strong> key in the Info.plist to <strong>TRUE</strong>, otherwise, after 30 minutes, the wifi will be shut down no matter what.</p>
<p>Thanks to the wisdom of the internet.</p>]]></content></entry><entry><title>BitmapFontAtlas performance optimizations</title><category term="cocos2d"/><category term="iphone, obj-c &amp; cocoa"/><category term="performance"/><id>http://fraggle.squarespace.com/blog/2009/6/1/bitmapfontatlas-performance-optimizations.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/6/1/bitmapfontatlas-performance-optimizations.html"/><author><name>Fraggle</name></author><published>2009-06-01T09:57:22Z</published><updated>2009-06-01T09:57:22Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>A very exciting new feature from cocos2D 0.8 is the addition of BitmapFontAtlas support. A BitmapFontAtlas is a combination of 2 files: a definition file (.fnt) and a texture file (.png). Contrary to the LabelAtlas, the font is no longer with fixed-width, and it looks much much better. It's also easier to manage and produce using various tools like <a href="http://www.n4te.com/hiero/hiero.jnlp">Hiero Font Tool</a></p>
<p>So because It looks so good, I went a little crazy and added a lot of them in my game. Unfortunatly, that's how I discovered a nasty performance issue with it, as each new instance would parse the font definition file, taking a few very noticable ms (look like hicups).</p>
<p>The fix is of course <strong>caching</strong>, but I wasn't sure the singleton "manager" design pattern would be in the spirit of the cocos lib and also, it would be a very small class so I searched for something else.</p>
<p>The final solution is a static NSMutableDictionnary on the BitmapFontAtlas class itself + a little bit of rerouting in the init method.</p>
<p>You can take a look at the issue &amp; my patch <a href="http://code.google.com/p/cocos2d-iphone/issues/detail?id=382">here</a>.</p>
<p>I'm interrested in comments on this trick :)</p>]]></content></entry><entry><title>Sample code for the loading screen</title><category term="cocos2d"/><category term="iphone, obj-c &amp; cocoa"/><category term="performance"/><id>http://fraggle.squarespace.com/blog/2009/5/31/sample-code-for-the-loading-screen.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/5/31/sample-code-for-the-loading-screen.html"/><author><name>Fraggle</name></author><published>2009-05-31T06:41:06Z</published><updated>2009-05-31T06:41:06Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>I've been pretty busy finishing up beta 2 of my game for the last few days so I'm a bit late.. but here goes some sample code for the loading screen implementation (my most popular post yet :)).</p>
<p>I'm using a state machine design pattern so in my "init game" state class: here is the code:</p>
<pre class="textmate-source twilight"><span class="source source_objc"><span class="meta meta_implementation meta_implementation_objc"><span class="meta meta_scope meta_scope_implementation meta_scope_implementation_objc"><span class="meta meta_function-with-body meta_function-with-body_objc"><span class="meta meta_function meta_function_objc">- <span class="meta meta_return-type meta_return-type_objc"><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span><span class="storage storage_type storage_type_id storage_type_id_objc">id</span><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span> <span class="entity entity_name entity_name_function entity_name_function_objc">init</span></span>
</span>{
    self = <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">super</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">init</span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    if ( self )
    {   
        // Add the Label (in cocos2D universe)
        BitmapFontAtlas *label = <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>BitmapFontAtlas <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">bitmapFontAtlasWithString<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="string string_quoted string_quoted_double string_quoted_double_objc"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_objc">@"</span>Initializing Game<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_objc">"</span></span> 
                                                                    <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">fntFile<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="string string_quoted string_quoted_double string_quoted_double_objc"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_objc">@"</span>comic_atlas.fnt<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_objc">"</span></span> 
                                                                  <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">alignment<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> UITextAlignmentCenter</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
        label.position = ccp(240, 160);
        label.opacity = 0;
        <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">addChild<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> label <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">z<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> 0 <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">tag<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> kInitializingLabel</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    
        // Add the UIActivityIndicatorView (in UIKit universe)
        self.activityIndicatorView = <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>UIActivityIndicatorView <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">alloc</span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">initWithActivityIndicatorStyle<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> UIActivityIndicatorViewStyleWhiteLarge</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">autorelease</span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
        activityIndicatorView.center = ccp(190,240);
        <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>activityIndicatorView <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">startAnimating</span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
        <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">battleView</span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">addSubview<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> activityIndicatorView</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    
        <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">schedule<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_selector meta_selector_objc"><span class="storage storage_type storage_type_objc"><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">@</span>selector</span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">(</span><span class="meta meta_selector meta_selector_method-name meta_selector_method-name_objc"><span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">loadingInit</span></span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">)</span></span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
        
        // At this point, the cocos2d rendering is fine.
    }</span>
    
    return <span class="variable variable_language variable_language_objc">self</span>;
}

<span class="meta meta_function-with-body meta_function-with-body_objc"><span class="meta meta_function meta_function_objc">- <span class="meta meta_return-type meta_return-type_objc"><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span>void<span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span> <span class="entity entity_name entity_name_function entity_name_function_objc">loadingInit</span></span>
</span>{
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">unschedule<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_selector meta_selector_objc"><span class="storage storage_type storage_type_objc"><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">@</span>selector</span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">(</span><span class="meta meta_selector meta_selector_method-name meta_selector_method-name_objc"><span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">loadingInit</span></span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">)</span></span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;

    // Fade in nicely
    BitmapFontAtlas *label = (BitmapFontAtlas*)<span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">getChildByTag<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> kInitializingLabel</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>label <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">runAction<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>FadeIn <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">actionWithDuration<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> .25</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;

    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">schedule<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_selector meta_selector_objc"><span class="storage storage_type storage_type_objc"><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">@</span>selector</span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">(</span><span class="meta meta_selector meta_selector_method-name meta_selector_method-name_objc"><span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">loadingStep0</span></span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">)</span></span> <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">interval<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> .25</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
}</span>

<span class="meta meta_function-with-body meta_function-with-body_objc"><span class="meta meta_function meta_function_objc">- <span class="meta meta_return-type meta_return-type_objc"><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span>void<span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span> <span class="entity entity_name entity_name_function entity_name_function_objc">loadingStep0</span></span>
</span>{
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">unschedule<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_selector meta_selector_objc"><span class="storage storage_type storage_type_objc"><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">@</span>selector</span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">(</span><span class="meta meta_selector meta_selector_method-name meta_selector_method-name_objc"><span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">loadingStep0</span></span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">)</span></span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    
    // Add you own code to load texture, sounds etc...
    // The cocos2D thread will be waiting (since it's the same as the main thread) but the UIKit thread will keep running in parallel
    
    // Can do multiple steps or just one
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">schedule<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_selector meta_selector_objc"><span class="storage storage_type storage_type_objc"><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">@</span>selector</span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">(</span><span class="meta meta_selector meta_selector_method-name meta_selector_method-name_objc"><span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">loadingStep1</span></span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">)</span></span> <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">interval<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> .5</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
}</span>

<span class="meta meta_function-with-body meta_function-with-body_objc"><span class="meta meta_function meta_function_objc">- <span class="meta meta_return-type meta_return-type_objc"><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span>void<span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span> <span class="entity entity_name entity_name_function entity_name_function_objc">loadingStep1</span></span>
</span>{
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">unschedule<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_selector meta_selector_objc"><span class="storage storage_type storage_type_objc"><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">@</span>selector</span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">(</span><span class="meta meta_selector meta_selector_method-name meta_selector_method-name_objc"><span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">loadingStep1</span></span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">)</span></span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;

    // Add you own code to load texture, sounds etc...

    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">schedule<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_selector meta_selector_objc"><span class="storage storage_type storage_type_objc"><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">@</span>selector</span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">(</span><span class="meta meta_selector meta_selector_method-name meta_selector_method-name_objc"><span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">loadingDone</span></span><span class="punctuation punctuation_definition punctuation_definition_storage punctuation_definition_storage_type punctuation_definition_storage_type_objc">)</span></span> <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">interval<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> .1</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
}</span>

<span class="meta meta_function-with-body meta_function-with-body_objc"><span class="meta meta_function meta_function_objc">- <span class="meta meta_return-type meta_return-type_objc"><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span>void<span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span> <span class="entity entity_name entity_name_function entity_name_function_objc">loadingDone</span></span>
</span>{
    gameIsReady = <span class="constant constant_language constant_language_objc">YES</span>;
    
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span>.activityIndicatorView <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">removeFromSuperview</span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    
    BitmapFontAtlas *label = (BitmapFontAtlas*)<span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">getChildByTag<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> kInitializingLabel</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>label <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">setString<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> NSLocalizedString(<span class="string string_quoted string_quoted_double string_quoted_double_objc"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_objc">@"</span>Tap to start!<span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_objc">"</span></span>, <span class="constant constant_language constant_language_objc">nil</span>)</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    
    <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>label <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">runAction<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>RepeatForever <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">actionWithAction<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> 
                       <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>Sequence <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">actionOne<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>EaseInOut <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">actionWithAction<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>MoveTo <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">actionWithDuration<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> .6 <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">position<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span><span class="meta meta_function-call meta_function-call_c"><span class="punctuation punctuation_whitespace punctuation_whitespace_function-call punctuation_whitespace_function-call_leading punctuation_whitespace_function-call_leading_c"> </span><span class="support support_function support_function_any-method support_function_any-method_c">ccp</span>(</span>210, 160)</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span> <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">rate<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> 2</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span> 
                                       <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">two<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>EaseInOut <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">actionWithAction<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span>MoveTo <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">actionWithDuration<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> .6 <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">position<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span><span class="meta meta_function-call meta_function-call_c"><span class="punctuation punctuation_whitespace punctuation_whitespace_function-call punctuation_whitespace_function-call_leading punctuation_whitespace_function-call_leading_c"> </span><span class="support support_function support_function_any-method support_function_any-method_c">ccp</span>(</span>270, 160)</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span> <span class="support support_function support_function_any-method support_function_any-method_name-of-parameter support_function_any-method_name-of-parameter_objc">rate<span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span> 2</span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>
                        </span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>       
                       </span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>
     </span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    
}</span>

<span class="meta meta_function-with-body meta_function-with-body_objc"><span class="meta meta_function meta_function_objc">- <span class="meta meta_return-type meta_return-type_objc"><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span><span class="storage storage_type storage_type_objc">BOOL</span><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span><span class="entity entity_name entity_name_function entity_name_function_objc">ccTouchesEnded</span></span><span class="meta meta_argument-type meta_argument-type_objc"><span class="entity entity_name entity_name_function entity_name_function_name-of-parameter entity_name_function_name-of-parameter_objc"><span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span><span class="support support_class support_class_cocoa">NSSet</span> *<span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_objc">touches</span></span> <span class="entity entity_name entity_name_function entity_name_function_name-of-parameter entity_name_function_name-of-parameter_objc">withEvent</span><span class="meta meta_argument-type meta_argument-type_objc"><span class="entity entity_name entity_name_function entity_name_function_name-of-parameter entity_name_function_name-of-parameter_objc"><span class="punctuation punctuation_separator punctuation_separator_arguments punctuation_separator_arguments_objc">:</span></span><span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">(</span>UIEvent *<span class="punctuation punctuation_definition punctuation_definition_type punctuation_definition_type_objc">)</span><span class="variable variable_parameter variable_parameter_function variable_parameter_function_objc">event</span></span>
</span>{
    if ( gameIsReady )
    {
        <span class="meta meta_bracketed meta_bracketed_objc"><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_begin punctuation_section_scope_begin_objc">[</span><span class="variable variable_language variable_language_objc">self</span> <span class="meta meta_function-call meta_function-call_objc"><span class="support support_function support_function_any-method support_function_any-method_objc">openGame</span></span><span class="punctuation punctuation_section punctuation_section_scope punctuation_section_scope_end punctuation_section_scope_end_objc">]</span></span>;
    }</span>
    
    return kEventHandled;
}</span></span></span></pre>
<p>If you need more explanations, please let me know.</p>]]></content></entry><entry><title>Multi-threading final toughts &amp; Loading screen</title><category term="cocos2d"/><category term="iphone, obj-c &amp; cocoa"/><category term="performance"/><category term="ui"/><id>http://fraggle.squarespace.com/blog/2009/5/27/multi-threading-final-toughts-loading-screen.html</id><link rel="alternate" type="text/html" href="http://fraggle.squarespace.com/blog/2009/5/27/multi-threading-final-toughts-loading-screen.html"/><author><name>Fraggle</name></author><published>2009-05-27T05:19:22Z</published><updated>2009-05-27T05:19:22Z</updated><content type="html" xml:lang="fr-FR"><![CDATA[<p>Well.. So I implemented the operation queue and it's indeed very easy to use BUT.. actually not useful for me.</p>
<p>My goal was to parallelize the pre-loading of textures while keeping the cocos2D rendering loop active so the UI wont seems "frozen".</p>
<p>However, in my particular case, I was creating textures while the main thread was living his own life.</p>
<p>So when I would add a texture, the cocos2D OpenGL loop might not be in the correct state and the app might crash "randomly".</p>
<p>I tried another solution with loading "steps": load some files, wait, load some other files... But the loading screen would lock up, animate, lock up, animate etc.. Not satisfying.</p>
<p>What I need was another rendering thread.. So I ended up by mixing UIKit (wich has his own rendering thread) and Cocos, just for the loading screen: my loading scene has now an UIActivityIndicatorView until the loading has completed. It looks very nice and polished, but take a look yourself :)</p>
<p><span class="thumbnail-image-block ssNonEditable"><span><a href="javascript:showFullImage('/display/ShowImage?imageUrl=%2Fstorage%2Fstep1.jpg%3F__SQUARESPACE_CACHEVERSION%3D1243402514218',414,770);"><img style="width: 400px;" src="http://fraggle.squarespace.com/storage/step1.jpg?__SQUARESPACE_CACHEVERSION=1243402637319" alt="" /></a></span></span></p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 400px;" src="http://fraggle.squarespace.com/storage/step2.jpg?__SQUARESPACE_CACHEVERSION=1243402662328" alt="" /></span></span></p>]]></content></entry></feed>