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

<channel>
	<title>Snowferno &#187; Blog</title>
	<atom:link href="http://www.snowferno.com/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snowferno.com</link>
	<description>Do you have a snowball's chance?</description>
	<lastBuildDate>Mon, 26 Oct 2009 23:01:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Playhaven.com-powered Community Is Live</title>
		<link>http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/</link>
		<comments>http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 22:55:40 +0000</pubDate>
		<dc:creator>balord</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=114</guid>
		<description><![CDATA[The gang at Playhaven just gave us the go-ahead to point our "Tips" button to the Snowferno game pages on playhaven.com.
Ben wrote previously about why we chose Playhaven to power our Support/Community features.  He also wrote over on the escapeFactory blog how to open a UIWebView in Unity3D, which was essential to integrating Playhaven's [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/ca32281f6b82e611c51ccf7a6863c53b?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>The gang at Playhaven just gave us the go-ahead to point our "Tips" button to the <a href="http://www.playhaven.com/platforms/iphone/games/snowferno/">Snowferno game pages</a> on playhaven.com.</p>
<p>Ben wrote <a href="/2009/09/23/playhaven-unity-and-snowferno/">previously</a> about why we chose Playhaven to power our Support/Community features.  He also wrote over on the escapeFactory blog <a href="http://escfactory.com/2009/09/opening-a-uiwebview-from-within-unity3d/">how to open a UIWebView in Unity3D</a>, which was essential to integrating Playhaven's model with Snowferno.</p>
<p>We're really excited about this partnership and the community features that Playhaven enables.</p>
<p>Here are some screenshots of what you'll find when you tap "Tips" from the Snowferno main menu... Enjoy!</p>
<p>(P.S: sorry I don't have a Lightbox plugin on the site yet -- it's added to my to-do list...)</p>

<a href='http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/playhaven_1_fan/' title='playhaven_1_fan'><img width="150" height="150" src="http://www.snowferno.com/wp-content/uploads/2009/10/playhaven_1_fan-150x150.jpg" class="attachment-thumbnail" alt="" title="playhaven_1_fan" /></a>
<a href='http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/playhaven_2_register/' title='playhaven_2_register'><img width="150" height="150" src="http://www.snowferno.com/wp-content/uploads/2009/10/playhaven_2_register-150x150.jpg" class="attachment-thumbnail" alt="" title="playhaven_2_register" /></a>
<a href='http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/playhaven_3_login/' title='playhaven_3_login'><img width="150" height="150" src="http://www.snowferno.com/wp-content/uploads/2009/10/playhaven_3_login-150x150.jpg" class="attachment-thumbnail" alt="" title="playhaven_3_login" /></a>
<a href='http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/playhaven_4_news/' title='playhaven_4_news'><img width="150" height="150" src="http://www.snowferno.com/wp-content/uploads/2009/10/playhaven_4_news-150x150.jpg" class="attachment-thumbnail" alt="" title="playhaven_4_news" /></a>
<a href='http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/playhaven_5_qa/' title='playhaven_5_QA'><img width="150" height="150" src="http://www.snowferno.com/wp-content/uploads/2009/10/playhaven_5_QA-150x150.jpg" class="attachment-thumbnail" alt="" title="playhaven_5_QA" /></a>
<a href='http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/playhaven_6_guides/' title='playhaven_6_guides'><img width="150" height="150" src="http://www.snowferno.com/wp-content/uploads/2009/10/playhaven_6_guides-150x150.jpg" class="attachment-thumbnail" alt="" title="playhaven_6_guides" /></a>
<a href='http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/playhaven_7_rate/' title='playhaven_7_rate'><img width="150" height="150" src="http://www.snowferno.com/wp-content/uploads/2009/10/playhaven_7_rate-150x150.jpg" class="attachment-thumbnail" alt="" title="playhaven_7_rate" /></a>

]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/10/26/playhaven-com-powered-community-is-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On bad reviews</title>
		<link>http://www.snowferno.com/2009/10/22/on-bad-reviews/</link>
		<comments>http://www.snowferno.com/2009/10/22/on-bad-reviews/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 04:27:44 +0000</pubDate>
		<dc:creator>balord</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=113</guid>
		<description><![CDATA[It's easy to get spoiled with good reviews, and even easier to quote just those.  But what about bad reviews?
Well, you're going to find them, so we'd be stupid to pretend they don't exist.  And one of our first was Ben Briggs' Snowferno review today on we play iPhone.
Right off the bat, it's [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/ca32281f6b82e611c51ccf7a6863c53b?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>It's easy to get spoiled with good reviews, and even easier to quote just those.  But what about bad reviews?</p>
<p>Well, you're going to find them, so we'd be stupid to pretend they don't exist.  And one of our first was Ben Briggs' <a href="http://www.weplayiphone.com/games/Snowferno">Snowferno review</a> today on <a href="http://weplayiphone.com">we play iPhone</a>.</p>
<p>Right off the bat, it's pretty impossible to recover when the reviewer expected from our app title a different game than what we wrote, but his review still had some good points.  We don't think that what essentially boils down to "not terribly compelling" merits a D rating, but maybe a year ago -- when there weren't 100,000 other apps to choose from -- we might have scored better with our freshman effort.</p>
<p>Our goal with Snowferno was <a href="/2009/05/07/welcome-to-the-development-blog/">always</a>, in fact, to tackle the App Store with a simple concept and learn a ton getting it built.  We're extra pleased that most people love playing it.  And if not?  Well, we're just getting going and maybe you'll like our next one better.  :)</p>
<p>Unity3D is progressing, as is our knowledge of optimizing within that game engine... we'll see if we can't also smooth out some more of those terrain bugs.  But thanks to Ben Briggs for giving us his time for a review!</p>
<p>And last -- about the demerit for "no save state"... he must mean returning mid-level i.e. if interrupted by a call.  But it makes it sound like we make you replay Snowferno from the beginning each time, which isn't true.  There is a world map, and any level you solve is unlocked for good.  Even if you have to reinstall Snowferno, our leaderboard remembers and unlocks your game the next time you boot up.</p>
<p>Not to split hairs, but I just wanted to point that out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/10/22/on-bad-reviews/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New iTunes App Store reviews</title>
		<link>http://www.snowferno.com/2009/10/18/new-itunes-app-store-reviews/</link>
		<comments>http://www.snowferno.com/2009/10/18/new-itunes-app-store-reviews/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 03:43:54 +0000</pubDate>
		<dc:creator>balord</dc:creator>
				<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=112</guid>
		<description><![CDATA[3 new (ahem, glowing) reviews from the iTunes App Store:
Very Fun &#038; Challenging - 5 stars, by Greg Meach
"Starts out very easy but then fairly quickly it will challenge you. The online scoring keeps you coming back to try and improve your time(s). Once you solve the level that is. Check out the web site [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/ca32281f6b82e611c51ccf7a6863c53b?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>3 new (ahem, glowing) <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=325000280&pageNumber=0&sortOrdering=1&type=Purple+Software">reviews</a> from the iTunes App Store:</p>
<p><strong>Very Fun & Challenging</strong> - 5 stars, by <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewUsersUserReviews?userProfileId=28709263">Greg Meach</a><br />
"Starts out very easy but then fairly quickly it will challenge you. The online scoring keeps you coming back to try and improve your time(s). Once you solve the level that is. Check out the web site to see a demo. Highly recommend over many of the other "marble rolling" type games. The simple fact that you can get smaller (with fire) and larger (with snow) and a unique challenge."</p>
<p><strong>Awesome Game</strong> - 5 stars, by <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewUsersUserReviews?userProfileId=19857342">I Firebird I</a><br />
"This game is so much fun! Challenging entertainment for everyone. Graphics make you feel like you're there. The controls are great and quick to learn. Makes great use of the accelerometer. The adjustable camera angles is a real plus which most developers forget about. And with the leaderboard this game has it all - a must get."</p>
<p><strong>Great game!!!</strong> - 4 stars, by <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewUsersUserReviews?userProfileId=41872806">ravenmk</a><br />
"Fun and pretty ... Love live highscores :D"</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/10/18/new-itunes-app-store-reviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snowferno v1.1 is out</title>
		<link>http://www.snowferno.com/2009/10/08/snowferno-v1-1-is-out/</link>
		<comments>http://www.snowferno.com/2009/10/08/snowferno-v1-1-is-out/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 03:06:48 +0000</pubDate>
		<dc:creator>balord</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Software Updates]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=111</guid>
		<description><![CDATA[The v1.1 update to Snowferno is now Ready For Sale!!  Of course, if you already have it, just check your iTuneses or App Store "Updates" button for your free fresh copy.
In this update you will find:

Better performance for all devices
Built with new Unity iPhone 1.5
New Global Leaderboard integration in-game with webview
New tips from the [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/ca32281f6b82e611c51ccf7a6863c53b?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>The v1.1 update to Snowferno is now Ready For Sale!!  Of course, if you already have it, just check your iTuneses or App Store "Updates" button for your free fresh copy.</p>
<p>In this update you will find:</p>
<ul>
<li>Better performance for all devices</li>
<li>Built with new <a href="http://unity3d.com/unity/whats-new/iphone-1.5">Unity iPhone 1.5</a></li>
<li>New Global Leaderboard integration in-game with webview</li>
<li>New tips from the Community powered by (the already-launched-but-soon-to-be-styled-for-in-game-coolness) <a href="http://www.playhaven.com/platforms/iphone/games/snowferno/">playhaven.com</a></li>
<li>Fixed a few terrain bugs where you could get stuck</li>
</ul>
<p>Happy rolling!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/10/08/snowferno-v1-1-is-out/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Indie Game Marketing for Developers</title>
		<link>http://www.snowferno.com/2009/10/07/indie-game-marketing-for-developers/</link>
		<comments>http://www.snowferno.com/2009/10/07/indie-game-marketing-for-developers/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 00:43:05 +0000</pubDate>
		<dc:creator>benbritten</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=110</guid>
		<description><![CDATA[Last week I attended the Digital Distribution Summit here in Melbourne with fellow Escape Factory collaborator John.  Even though the name makes you think it would be terribly boring, (it probably should have been called the Digital Games Distribution Summit, bit I digress) it was actually very good.  
You can watch all of [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/a1e8752136bc8045c465c739439460b2?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>Last week I attended the <a href="http://ddsummit.com/">Digital Distribution Summit</a> here in Melbourne with fellow <a href="http://escfactory.com">Escape Factory</a> collaborator John.  Even though the name makes you think it would be terribly boring, (it probably should have been called the Digital Games Distribution Summit, bit I digress) it was actually very good.  </p>
<p>You can watch all of the speakers on the <a href="http://ddsummit.com/">DDSummit site</a>, which you should go and do now, and not bother reading this silly post.</p>
<p>If you are still reading, I will give you my belated thoughts on the content provided in the summit.  If you did not attend or have no idea what I am talking about then here is the very brief overview:</p>
<p>The DDSummit was geared towards indie level game developers who are looking to take advantage of the increasingly popular and available digital distribution methods (like XBLA, PSX, WiiWare, AppStore etc..)  The talks ranged all over but ultimately were there to help the little guy (thats us!) succeed in this new marketplace.  There is a smaller barrier to entry to the indie game market now than any other time in history.  </p>
<p>So that is the overview, what are some of the specifics?</p>
<p>Since I am an iPhone developer (so far) I mostly tried to apply everything that was being said to my situation (which is: zero budget development for iPhone).</p>
<p>The biggest thing that I took away from this event was that marketing is the single most important thing you can be doing right now.  (cynically, I might even say that it is more important than having a good game)  This is of course not really news to me, but having it laid out so many times and so clearly, it really hit home the fact that we are not marketing our stuff enough.  This is a common problem with the indies, we are all very good at what we do (which might be programming, artwork, game design, sound, etc..) but we are not really very good at marketing (otherwise we would be professional marketing types right?)</p>
<p>The presenters made many good points re: marketing.  If you make the best game ever and nobody knows about it, then nobody will buy it.  </p>
<p>That begs the question:  How do we, as indie developers who suck at marketing.... how do we get the word out?</p>
<p>This is a summary, in no particular order of the hints, suggestions and tips to better marketing. Some of these are directly from the talks and others are things that I synthesized from my notes.</p>
<ul>
<li><strong>Start your marketing on day one.</strong>  Do not build a protorype, do not write a design document, do not brainstorm game mechanics.  The very first thing you need to do is start the marketing process.  Write a blog post, tweet, whatever.  Then start the actual development.  Well, ok that might be a bit hyperbolic, but marketing needs to be in your plan from the very start.</li>
<li><strong>Marketing should be part of your dev process.</strong> Just like everything else you are doing to build your game.  Add marketing tasks into the flow.  Blog about what you are doing, tweet your advances and your challenges, solicit gamer feedback from your early design ideas</li>
<li><strong>Define your target audience.</strong> Figure out who is going to care about this game you are making.  Define a narrow group of people (dont say: this game is for everyone! because it isn't.) focus on a realistic group and cater your marketing to that group.</li>
<li><strong>Define your brand.</strong> As indies this tends to get lost.  Also often the brand become synonymous with the first successful game you develop.  As indies, our brand is our individual style and story.  Half of selling your games and ideas as an indie is having a compelling story.  By story I mean who you are and what it is you do. </li>
<li><strong>Twitter.</strong> I think I heard the word twitter or tweet about 900 times.  Twitter is the current social networking fad, and you should be using it.  Twitter is a multiplier for word of mouth.  Similarly, you should be abusing your facebook friends and using all those digital contacts to help push your game.  </li>
<li><strong>Blog.</strong> You should have some sort of web site/blog for your game or development studio.  (like this one! hello!)  Try to keep your blog fairly up to date with current topical posts that people will hopefully find interesting.  This will help keep your name and game in the tops of people's minds.</li>
<li><strong>Make good gameplay videos.</strong> Sometime after day 1, when you already started your marketing and everyone is anticipating your game release, you will need to make a good gameplay video.  Again, tailor this to your target audience. Be sure to show some actual gameplay though.  There is nothing more annoying than a game trailer that has no actual game footage.</li>
<li><strong>Enter every festival and contest you can.</strong> Do you qualify for the entry requirements? then enter it.  Even if you don't get in, or don't win you will generally get some exposure and some good game player feedback.</li>
<li><strong>Engage the community</strong> Go and be active in the forums and the blogs that are specific to your target audience.  Be a part of the gamer community.  Give back via your blog. Post how-tos and code snippets. </li>
</ul>
<p>That is a pretty good list to start.  </p>
<p>Trust me when I tell you that I sympathize with all the indies out there who are already busy just trying to build their games, let alone do all that other stuff.  It took me a week just to write this post because I was too busy with other projects.  However, in order to be a successful game developer you need to also be a successful marketer.  </p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/10/07/indie-game-marketing-for-developers/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Snowferno Update Coming Soon</title>
		<link>http://www.snowferno.com/2009/09/28/snowferno-update-coming-soon/</link>
		<comments>http://www.snowferno.com/2009/09/28/snowferno-update-coming-soon/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 21:43:32 +0000</pubDate>
		<dc:creator>balord</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[Software Updates]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=109</guid>
		<description><![CDATA[We just submitted v1.1 of Snowferno to the App Store for approval last night.
This update was built with the new Unity iPhone 1.5 and the latest iPhone SDK, bringing significant performance improvements across all devices. Gameplay is really smooth now on my iPhone 3G.
Also new in v1.1:

New Leaderboard integration in-game with UIWebView
New Tips community in-game [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/ca32281f6b82e611c51ccf7a6863c53b?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>We just submitted v1.1 of Snowferno to the App Store for approval last night.</p>
<p>This update was built with the new Unity iPhone 1.5 and the latest iPhone SDK, bringing significant performance improvements across all devices. Gameplay is really smooth now on my iPhone 3G.</p>
<p>Also new in v1.1:</p>
<ul>
<li>New Leaderboard integration in-game with UIWebView</li>
<li>New Tips community in-game -- powered by <a href="http://www.playhaven.com/platforms/iphone/games/snowferno/">playhaven.com</a></li>
<li>Fixed a few terrain bugs where you could get stuck (thanks, <a href="/leaderboard/Belly%20Lint/">Belly Lint</a>!)</li>
</ul>
<p>And any Unity devs that want to know how Ben got UIWebView working in Unity, check out his blog post <a href="/2009/09/23/playhaven-unity-and-snowferno/">Playhaven, Unity, and Snowferno</a> complete with downloadable sample AppController code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/09/28/snowferno-update-coming-soon/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tips for Levels 1 thru 3</title>
		<link>http://www.snowferno.com/2009/09/28/tips-for-levels-1-thru-3/</link>
		<comments>http://www.snowferno.com/2009/09/28/tips-for-levels-1-thru-3/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 20:17:05 +0000</pubDate>
		<dc:creator>balord</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=108</guid>
		<description><![CDATA[Watch for our upcoming in-game fan community launching soon -- powered by playhaven.com.
Level 1: The Dark Wood
This is the standard "teaching" first level.  All you need to do is figure out how to roll forward and turn just a bit to get into the exit.
Level 2: Little Jump
Here we have our first challenge.  [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/ca32281f6b82e611c51ccf7a6863c53b?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><div class="notice" style="margin-right:130px;font-weight:bold;">Watch for our upcoming in-game fan community launching soon -- powered by <a href="http://www.playhaven.com/platforms/iphone/games/snowferno/">playhaven.com</a>.</div>
<p><strong>Level 1: The Dark Wood</strong><br />
This is the standard "teaching" first level.  All you need to do is figure out how to roll forward and turn just a bit to get into the exit.</p>
<p><strong>Level 2: Little Jump</strong><br />
Here we have our first challenge.  You are too small to get across the gap to the exit, so find some snow to get bigger.  But dont take too long -- summer is coming and you'll melt!</p>
<p><strong>Level 3: Switches</strong><br />
Here we see our first of many interactive items you'll encounter in the Inferno: switches.  There are two on this level -- one on the floor that drops your platform down to the lower level, and another that lowers the drawbridge so you can cross to the finish.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/09/28/tips-for-levels-1-thru-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playhaven, Unity and Snowferno</title>
		<link>http://www.snowferno.com/2009/09/23/playhaven-unity-and-snowferno/</link>
		<comments>http://www.snowferno.com/2009/09/23/playhaven-unity-and-snowferno/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 01:47:42 +0000</pubDate>
		<dc:creator>benbritten</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=104</guid>
		<description><![CDATA[There is a new player in the iPhone-support website game: PlayHaven.  They are similar to Openfeint and Agon in that they provide some 3rd-party support for your game.  Unlike OF and Agon, Playhaven does not provide leaderboards and that sort of thing, instead they are trying to build a gaming community around guides, [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/a1e8752136bc8045c465c739439460b2?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>There is a new player in the iPhone-support website game: <a href="http://www.playhaven.com/">PlayHaven</a>.  They are similar to Openfeint and Agon in that they provide some 3rd-party support for your game.  Unlike OF and Agon, Playhaven does not provide leaderboards and that sort of thing, instead they are trying to build a gaming community around guides, hints, and forums.</p>
<p>In any case, back in the early days of the iPhone game development (like half a year ago) there were far fewer choices for adding leaderboard/achievement support to your app via 3rd party.  So after looking at the early OF and others and not being very happy with what they offered (at the time) we decided to go ahead and build our own leaderboards.</p>
<p>So, why playhaven then?</p>
<p>Well, ultimately it comes down to them emailing me and asking me to try it out.  We dont currently have any of the features they offer, so the fit seemed good.  Also, one nice thing about playhaven is that they are basing their entire 'api' (if you could call it that) around the UIWebView.  In other words there is no actual SDK to add to your code, you just whip open an in-app web view and there is the community.</p>
<p>For a programmer this is very nice.  I really really do not like to add 3rd party code to my apps unless i really really need to (less code == less bugs).  Especially in cases like OF and Agon, who (much to their credit) are releasing new patches fairly quickly.  This is great from a feature standpoint, but bad from a trying-to-keep-my-code-up-to-date standpoint.</p>
<p>Once you get two or three games going, just keeping up with the iPhone SDK changes is hard enough (not to mention we need to be generating new content and add polish to our apps every couple of weeks to keep sales up) adding yet another chunk of software that I have to keep up to date is yet another thing I have little time for.  From the start with our own leaderboards we tried to offload as much of the process as possible to the webservers so that we could easily and quickly update and change things without having to change the game code, Playhaven fits well with this line of thinking.</p>
<p>With Playhaven, I just add a webview and a URL.  And we are going to put a redirect script on our site and call that URL instead, so if the playhaven URL api gets changed or updated, then we just have to update our redirector and all of our games will continue to work.</p>
<p>Ok, now for the bad news:  opening up a UIWebview from within Unity is a non-trivial task. You cant actually do it from the unity engine.  (well, not yet in any case, those Unity guys are adding new stuff constantly)  Well, OK that is not entirely true.  If you have Unity iPhone Advanced then you can add a plugin that calls out to the ObjC/cocoa stuff and does all your web ui view stuff from there.  but you still need to write some ObjC/Cocoa.</p>
<p>So how do we do this?  How do we get the Playhaven page to open overtop of the unity view?</p>
<p>The simplest way is to use the tried and true 'user prefs' hack.  Since the advent of Unity iPhone Support, there have been a few enterprising developers who pioneered the technique of using the User Prefs as a communications link between Unity and Cocoa.</p>
<p>(There have been quite a few people who discussed this technique in the unity forums and I dont want to make light of their contributions, but I want to make a special shout out to blipRob aka stinkbot, who produces the fantastic <a href="http://stinkbot.com/u3d/index.html">Unity iPhone Enhancement pack</a>, which I recommend as it allows you to do so many more things than just open a UIWebView, and makes integrating the playhaven stuff as simple as adding a dozen or so lines to the enhancement pack code.  In fact he probably already has stuff in there to do it, I have an early version of the EP that I have hacked into my own thing so I havent updated recently.  But really, buy a copy of the EP and this becomes much much simpler.)</p>
<p>OK, so how does this work?</p>
<p>From unity we set a value to the PlayerPrefs, like so:</p>
<pre class="c">   PlayerPrefs.<span style="color: #202020;">SetString</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bbcommand&quot;</span>, <span style="color: #ff0000;">&quot;BBWebUI|&quot;</span>+fullUrl<span style="color: #66cc66;">&#41;</span>;</pre>
<p>Note: you will need to have some well-formed URL in the fullUrl variable.</p>
<p>The PlayerPrefs are actually stored in the NSUserDefaults dictionary, so we can get that out from the Cocoa side like so:</p>
<pre class="objc">&nbsp;
&nbsp;
<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html"><span style="color: #0000ff;">NSString</span></a>* commandString = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSUserDefaults.html"><span style="color: #0000ff;">NSUserDefaults</span></a> standardUserDefaults<span style="color: #002200;">&#93;</span> objectForKey:@<span style="color: #666666;">&quot;bbcommand&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;</pre>
<p>So that is how we can get information back and forth between the Unity world and the Cocoa world.  But how do we use this to our benefit?  We need to be looking for that command to show up in the NSUserDefaults dictionary and then act on it when we see it.</p>
<p>For this to happen we need to have some extra code running besides the standard Unity stuff.  There are a few ways of handling this but the lease destructive and easiest to add into your game is to add a category extension to the AppController object in the unity code.</p>
<p>For our purposes I am going to presume that you are updated to the 1.5 unity iPhone and if you havent, then why not?  go do that now.</p>
<p>Here it is: the absolute simplest way to insert your own code into the unity code:</p>
<pre class="objc">&nbsp;
<span style="color: #339900;">#import &quot;AppController.h&quot;</span>
<span style="color: #339900;">#import &quot;BBUnityHandler.h&quot;</span>
&nbsp;
<span style="color: #0000ff;">void</span> UnityInitApplication<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span>* appPathName<span style="color: #002200;">&#41;</span>;
<span style="color: #0000ff;">void</span> UnitySetAudioSessionActive<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">bool</span> active<span style="color: #002200;">&#41;</span>;
<span style="color: #0000ff;">void</span> UnityPause<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">bool</span> pause<span style="color: #002200;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">@interface</span> AppController <span style="color: #002200;">&#40;</span>BBUnity<span style="color: #002200;">&#41;</span>
<span style="color: #ff0000;">// our two 'public' methods</span>
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>pauseUnity;
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>resumeUnity;
&nbsp;
<span style="color: #0000ff;">@end</span>
&nbsp;
<span style="color: #0000ff;">@implementation</span> AppController <span style="color: #002200;">&#40;</span>BBUnity<span style="color: #002200;">&#41;</span>
&nbsp;
<span style="color: #ff0000;">// override the app did finish launch method and add our single line of code</span>
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span> applicationDidFinishLaunching:<span style="color: #002200;">&#40;</span>UIApplication*<span style="color: #002200;">&#41;</span>application
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>self startUnity:application<span style="color: #002200;">&#93;</span>;
	<span style="color: #ff0000;">// start our custom code here</span>
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>BBUnityHandler sharedHandler<span style="color: #002200;">&#93;</span> startHandler:self<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #ff0000;">// this will resume the unity engine after we have paused it</span>
-<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>resumeUnity
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIApplication sharedApplication<span style="color: #002200;">&#93;</span> setStatusBarOrientation:
                 UIInterfaceOrientationLandscapeRight<span style="color: #002200;">&#93;</span>;
&nbsp;
	UnitySetAudioSessionActive<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">true</span><span style="color: #002200;">&#41;</span>;
	UnityPause<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">false</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #ff0000;">// this will pause the unity engine</span>
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>pauseUnity
<span style="color: #002200;">&#123;</span>
	UnitySetAudioSessionActive<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">false</span><span style="color: #002200;">&#41;</span>;
	UnityPause<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">true</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">@end</span>
&nbsp;</pre>
<p>OK, what is this doing?  Basically this is putting a hook into the unity startup process that also starts up our custom code.  In this case it calls my BBUnityHandler object and starts it up with a reference to the app controller.</p>
<p>This method is a bit different from the other unity AppController addons I have seen.  I like this way because it is clean and simple.  It keeps my code nicely separated from the AppController code.</p>
<p>So lets have a look and see what the BBUnityHandler is doing:</p>
<p>Lets us look at the first two methods we have seen: the class method: sharedHandler and the instance method startHandler:</p>
<pre class="objc">&nbsp;
<span style="color: #ff0000;">// Singleton accessor.  this is how you should ALWAYS get a reference</span>
<span style="color: #ff0000;">// to the sound controller.  Never init your own.</span>
+<span style="color: #002200;">&#40;</span>BBUnityHandler*<span style="color: #002200;">&#41;</span>sharedHandler
<span style="color: #002200;">&#123;</span>
  <span style="color: #0000ff;">static</span> BBUnityHandler *sharedHandler;
  <span style="color: #0000ff;">@synchronized</span><span style="color: #002200;">&#40;</span>self<span style="color: #002200;">&#41;</span>
  <span style="color: #002200;">&#123;</span>
    <span style="color: #0000ff;">if</span> <span style="color: #002200;">&#40;</span>!sharedHandler<span style="color: #002200;">&#41;</span>
      sharedHandler = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>BBUnityHandler alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #0000ff;">return</span> sharedHandler;
  <span style="color: #002200;">&#125;</span>
	<span style="color: #0000ff;">return</span> sharedHandler;
<span style="color: #002200;">&#125;</span>
&nbsp;
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>startHandler:<span style="color: #002200;">&#40;</span>AppController*<span style="color: #002200;">&#41;</span>aController;
<span style="color: #002200;">&#123;</span>
	self.unityController = aController;
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSUserDefaults.html"><span style="color: #0000ff;">NSUserDefaults</span></a> standardUserDefaults<span style="color: #002200;">&#93;</span> addObserver:self
             forKeyPath:@<span style="color: #666666;">&quot;bbcommand&quot;</span>
             options:NSKeyValueObservingOptionNew context:<span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;</pre>
<p>First up we have a simple singleton accessor method, this creates a new object if there is not one and stashes the reference in a static variable so that you always get the same one every time you call it.</p>
<p>Second we have our own start method.  This simple retains a reference to the AppController so that we can make calls against it later. Then we hook up our key value observer to keep an eye on the NSUserDefaults dictionary so we will get a notification if our command ever changes.</p>
<p>In order for the KVO to work we need to add our callback method:</p>
<pre class="objc">&nbsp;
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>observeValueForKeyPath:<span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html"><span style="color: #0000ff;">NSString</span></a> *<span style="color: #002200;">&#41;</span>keyPath
               ofObject:<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">id</span><span style="color: #002200;">&#41;</span>object
               change:<span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSDictionary.html"><span style="color: #0000ff;">NSDictionary</span></a> *<span style="color: #002200;">&#41;</span>change
               context:<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span> *<span style="color: #002200;">&#41;</span>context
<span style="color: #002200;">&#123;</span>
	<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html"><span style="color: #0000ff;">NSString</span></a>* commandString = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSUserDefaults.html"><span style="color: #0000ff;">NSUserDefaults</span></a> standardUserDefaults<span style="color: #002200;">&#93;</span>
                       objectForKey:@<span style="color: #666666;">&quot;bbcommand&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #0000ff;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>commandString == <span style="color: #0000ff;">nil</span><span style="color: #002200;">&#41;</span> || <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>commandString lenght<span style="color: #002200;">&#93;</span> &amp;lt; <span style="color: #0000dd;">1</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span><span style="color: #0000ff;">return</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>self performSelectorOnMainThread:<span style="color: #0000ff;">@selector</span><span style="color: #002200;">&#40;</span>handleCommand:<span style="color: #002200;">&#41;</span>
                      withObject:commandString waitUntilDone:NO<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;</pre>
<p>This is pretty simple: grab the command string from the dictionary, check to make sure it is legit and dispatch it.  The last line is important, we jump off this thread and jump to the main thread.  Mostly we want to do this because we are going to be doing UI stuff and that is best handled on the main thread.  Why do we need to do this?  The KVO stuff is handled straight away on the same thread that the change was made, and I have no insight into the Unity black box, so I dont really know what thread I am on when this gets called so I want to get off of it and onto a known thread as quickly as I can.</p>
<p>OK, now we move to the handleCommand method which is being called on the main thread.</p>
<pre class="objc">&nbsp;
-<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>handleCommand:<span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html"><span style="color: #0000ff;">NSString</span></a>*<span style="color: #002200;">&#41;</span>commandString
<span style="color: #002200;">&#123;</span>
	<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSArray.html"><span style="color: #0000ff;">NSArray</span></a> *args = <span style="color: #002200;">&#91;</span>commandString componentsSeparatedByString: @<span style="color: #666666;">&quot;|&quot;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #0000ff;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>args objectAtIndex:<span style="color: #0000dd;">0</span><span style="color: #002200;">&#93;</span> isEqualToString:@<span style="color: #666666;">&quot;BBWebUI&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> &amp;amp;&amp;amp; <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>args count<span style="color: #002200;">&#93;</span> &amp;gt; <span style="color: #0000dd;">1</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#91;</span>self openWebUI:args<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSUserDefaults.html"><span style="color: #0000ff;">NSUserDefaults</span></a> standardUserDefaults<span style="color: #002200;">&#93;</span> setObject:@<span style="color: #666666;">&quot;&quot;</span> forKey:@<span style="color: #666666;">&quot;bbcommand&quot;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;</pre>
<p>Pretty simple, just parse the args into a nice array, check to make sure our command is roughly formatted right (ie there is at least one argument) and pass it on to the web ui method.  Finally we reset our command back to a blank command.  (note: this will actually cause our KVO method to get called again, but it will shunt out since there is no command there)</p>
<pre class="objc">&nbsp;
-<span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>openWebUI:<span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSArray.html"><span style="color: #0000ff;">NSArray</span></a>*<span style="color: #002200;">&#41;</span>args
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>unityController pauseUnity<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">// alloc a new window for my web view</span>
	overlayWindow = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIWindow alloc<span style="color: #002200;">&#93;</span> initWithFrame:<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIScreen mainScreen<span style="color: #002200;">&#93;</span> bounds<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">// make a toolbar and add a button right in the center</span>
	UIToolbar * toolbar = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIToolbar alloc<span style="color: #002200;">&#93;</span> initWithFrame:CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">431.0</span>, <span style="color: #0000dd;">320</span>, <span style="color: #0000dd;">49.0</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	UIBarButtonItem * okButton = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIBarButtonItem alloc<span style="color: #002200;">&#93;</span>
                   initWithTitle:@<span style="color: #666666;">&quot;Back to Snowferno&quot;</span>
                   style:UIBarButtonItemStyleBordered
                   target:self action:<span style="color: #0000ff;">@selector</span><span style="color: #002200;">&#40;</span>closeWebUI<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	UIBarButtonItem * flexiSpaceItem = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIBarButtonItem alloc<span style="color: #002200;">&#93;</span>
                   initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
                   target:<span style="color: #0000ff;">nil</span> action:<span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
	UIBarButtonItem * flexiSpaceItem2 = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIBarButtonItem alloc<span style="color: #002200;">&#93;</span>
                   initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace
                   target:<span style="color: #0000ff;">nil</span> action:<span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	toolbar.items	= <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSArray.html"><span style="color: #0000ff;">NSArray</span></a> arrayWithObjects:flexiSpaceItem,okButton,flexiSpaceItem2,<span style="color: #0000ff;">nil</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>okButton release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>flexiSpaceItem release<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>flexiSpaceItem2 release<span style="color: #002200;">&#93;</span>;	
&nbsp;
	<span style="color: #ff0000;">// add the toolbar to the new window and release it</span>
	<span style="color: #002200;">&#91;</span>overlayWindow addSubview:toolbar<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>toolbar release<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">// make my webview, assign self as the delegate</span>
	UIWebView * webView = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIWebView alloc<span style="color: #002200;">&#93;</span> initWithFrame:CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">0</span>, <span style="color: #0000dd;">320</span>, <span style="color: #0000dd;">431.0</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
	webView.scalesPageToFit = YES;
	webView.delegate = self;
	<span style="color: #002200;">&#91;</span>overlayWindow addSubview:webView<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">// add a spinner so the user is not waiting looking at nothing</span>
	spinner = <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIActivityIndicatorView alloc<span style="color: #002200;">&#93;</span>
              initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge<span style="color: #002200;">&#93;</span>;
	spinner.center = CGPointMake<span style="color: #002200;">&#40;</span><span style="color: #0000dd;">160.0</span>, <span style="color: #0000dd;">240.0</span><span style="color: #002200;">&#41;</span>;
	spinner.autoresizingMask = UIViewAutoresizingFlexibleRightMargin |
             UIViewAutoresizingFlexibleLeftMargin |UIViewAutoresizingFlexibleTopMargin |
             UIViewAutoresizingFlexibleBottomMargin;
	<span style="color: #002200;">&#91;</span>spinner startAnimating<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>overlayWindow addSubview:spinner<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">// show the window</span>
	<span style="color: #002200;">&#91;</span>overlayWindow makeKeyAndVisible<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">//Create a URL object.</span>
	<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSURL.html"><span style="color: #0000ff;">NSURL</span></a> *url = <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSURL.html"><span style="color: #0000ff;">NSURL</span></a> URLWithString:<span style="color: #002200;">&#91;</span>args objectAtIndex:<span style="color: #0000dd;">1</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">//URL Requst Object</span>
	<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSURLRequest.html"><span style="color: #0000ff;">NSURLRequest</span></a> *requestObj = <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSURLRequest.html"><span style="color: #0000ff;">NSURLRequest</span></a> requestWithURL:url<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #ff0000;">//Load the request in the UIWebView.</span>
	<span style="color: #002200;">&#91;</span>webView loadRequest:requestObj<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>webView release<span style="color: #002200;">&#93;</span>; <span style="color: #ff0000;">// the overlay window owns it now</span>
<span style="color: #002200;">&#125;</span></pre>
<p>Finally, the meat of our code: the actual web ui view.  The first thing we do in the longish method is pause unity.  Here is where our reference to the app controller is required.  This causes the unity engine to basically just freeze.  Now we can safely overlay our views without worrying what is going on in the engine.</p>
<p>In order to do this with minimal effect on the Unity code we are actually going to make a new window (which is fairly rare on the iPhone, you really should not need to do this very often)</p>
<p>OK, so we make a new window, then we make a toolbar with a back button and add that to our window.  Finally we add on our UIWebView and kick off the initial request.  (which is the URL that we get from the args array).</p>
<p>Since the web view will take some time to load the content, we also add a spinny indicator so that the user knows something is happening. Otherwise they have to sit and stare at a blank view for a few seconds while the URL loads.</p>
<p>OK, great! nearly done!</p>
<p>The first thing we need to do now is remove the spinner after the loading is done.  Handily we told the webview that we would be the delegate, so we get told when it has finished loading.</p>
<pre class="objc">- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>webViewDidFinishLoad:<span style="color: #002200;">&#40;</span>UIWebView *<span style="color: #002200;">&#41;</span>webView;
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>spinner removeFromSuperview<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#91;</span>spinner release<span style="color: #002200;">&#93;</span>;
	spinner = <span style="color: #0000ff;">nil</span>;
<span style="color: #002200;">&#125;</span></pre>
<p>Ok, that was easy.  Now the user is happily surfing the web inside our game.  We added a nice 'Back to the game' button so that after they are done reading tips on how to slay that big bad dragon or solve that hard puzzle or whatever, they can get back into Unity.</p>
<pre class="objc">&nbsp;
- <span style="color: #002200;">&#40;</span><span style="color: #0000ff;">void</span><span style="color: #002200;">&#41;</span>closeWebUI;
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>overlayWindow release<span style="color: #002200;">&#93;</span>;
	overlayWindow = <span style="color: #0000ff;">nil</span>;
	<span style="color: #002200;">&#91;</span>unityController resumeUnity<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre>
<p>That is it.  We release the window, which makes it go away and clean up all of it's own memory, then we resume the unity engine.</p>
<p>Here it all is in one big file:<br />
<a href='http://www.snowferno.com/wp-content/uploads/2009/09/AppController_BBUnity.mm.zip'>AppController_BBUnity.mm.zip</a></p>
<p>This is all going to be in the Snowferno 1.1 release which we are submitting in the next few days, so if you want to see this in action, then pick up a copy of Snowferno! :-)  (or if you find it useful, then help up out by picking up a copy and tell your friends :-)</p>
<p><strong>UPDATE</strong>: we had a bit of a burp with our wordpress so you could not download the file.  That should be all fixed now!  Thanks Brent!</p>
<p>Cheers!<br />
-ben</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/09/23/playhaven-unity-and-snowferno/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A few more media mentions for Snowferno</title>
		<link>http://www.snowferno.com/2009/09/03/a-few-more-media-mentions-for-snowferno/</link>
		<comments>http://www.snowferno.com/2009/09/03/a-few-more-media-mentions-for-snowferno/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 01:15:46 +0000</pubDate>
		<dc:creator>benbritten</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=103</guid>
		<description><![CDATA[Well, Brent and I spend the better part of the first day of release filling in webforms and following complicated email submission rules for probably two dozen sites.  A few have already given us a mention, so we wanted to say Thanks!
In no particular order:
MacObserver:
http://www.macobserver.com/tmo/article/snowferno_gives_a_snowball_a_chance_in_hell
MacNN:
http://www.macnn.com/iphoneappupdates/9/
AppShopper:
http://appshopper.com/games/snowferno
And as i mentioned before:
No dpad:
http://nodpad.com/2009/09/01/snowferno-rolls-into-app-store/
The noDpad one is a [...]]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/a1e8752136bc8045c465c739439460b2?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>Well, Brent and I spend the better part of the first day of release filling in webforms and following complicated email submission rules for probably two dozen sites.  A few have already given us a mention, so we wanted to say Thanks!</p>
<p>In no particular order:</p>
<p>MacObserver:<br />
<a href="http://www.macobserver.com/tmo/article/snowferno_gives_a_snowball_a_chance_in_hell">http://www.macobserver.com/tmo/article/snowferno_gives_a_snowball_a_chance_in_hell</a></p>
<p>MacNN:<br />
<a href="http://www.macnn.com/iphoneappupdates/9/">http://www.macnn.com/iphoneappupdates/9/</a></p>
<p>AppShopper:<br />
<a href="http://appshopper.com/games/snowferno">http://appshopper.com/games/snowferno</a></p>
<p>And as i mentioned before:<br />
No dpad:<br />
<a href="http://nodpad.com/2009/09/01/snowferno-rolls-into-app-store/">http://nodpad.com/2009/09/01/snowferno-rolls-into-app-store/</a></p>
<p>The noDpad one is a followup for the <a href="http://nodpad.com/2009/07/24/exclusive-hands-on-with-snowferno/">exclusive</a> that they did for us earlier, so it is sorta a review.  The others are pretty much just blurbs, mostly taken from the <a href="http://www.snowferno.com/media-kit/">media kit page</a> or the app store page. But we appreciate them no matter what!</p>
<p>Hopefully we will get a few more reviews in the coming weeks, and hopefully they will be positive!</p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/09/03/a-few-more-media-mentions-for-snowferno/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Snowferno is heating up</title>
		<link>http://www.snowferno.com/2009/09/01/snowferno-is-heating-up/</link>
		<comments>http://www.snowferno.com/2009/09/01/snowferno-is-heating-up/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 02:34:11 +0000</pubDate>
		<dc:creator>benbritten</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.snowferno.com/?p=102</guid>
		<description><![CDATA[Daniel, at no dpad wasted no time with a nice release post:
Snowferno Rolls into App Store
Nice turn of phrase, I am totally stealing that.
Cheers!
-B
]]></description>
			<content:encoded><![CDATA[<img alt='' src='http://www.gravatar.com/avatar/a1e8752136bc8045c465c739439460b2?s=96&amp;d=wavatar&amp;r=G' class='avatar avatar-96 photo' height='96' width='96' /><p>Daniel, at <a href="http://nodpad.com">no dpad</a> wasted no time with a nice release post:</p>
<p><a href="http://nodpad.com/2009/09/01/snowferno-rolls-into-app-store/">Snowferno Rolls into App Store</a></p>
<p>Nice turn of phrase, I am totally stealing that.</p>
<p>Cheers!<br />
-B</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snowferno.com/2009/09/01/snowferno-is-heating-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
