<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Emanuele Feronato</title>
	
	<link>http://www.emanueleferonato.com</link>
	<description>italian geek and PROgrammer</description>
	<lastBuildDate>Thu, 19 Nov 2009 23:21:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/EmanueleFeronato" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Marketing influences game revenue three times more than high scores</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/GinFUb21xU8/</link>
		<comments>http://www.emanueleferonato.com/2009/11/19/marketing-influences-game-revenue-three-times-more-than-high-scores/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 21:41:50 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Game design]]></category>
		<category><![CDATA[Monetize]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1980</guid>
		<description><![CDATA[Research by EEDAR has shown that a high marketing spend increases gross revenue three times more than high review scores. 
The perception that high scores are crucial to sales is a myth, said EEDAR&#8217;s Jesse Divnich speaking at the Montreal International Games Summit, and developers should realise the cold fact that a poor quality game [...]]]></description>
			<content:encoded><![CDATA[<p>Research by <a href="http://www.eedar.com/" target = "_blank">EEDAR</a> has shown that a high marketing spend increases gross revenue <strong>three times more</strong> than high review scores. </p>
<p>The perception that high scores are crucial to sales is a myth, said EEDAR&#8217;s Jesse Divnich speaking at the <a href="http://sijm.ca/2009/?language=en" target = "_blank">Montreal International Games Summit</a>, and developers should realise the cold fact that a poor quality game shipped with a big marketing spend will sell much better than a great game with little financial support behind it. </p>
<p>You can make the greatest game and it won&#8217;t even matter. I know that&#8217;s discouraging to developers at first but it&#8217;s very true.</p>
<p>Looking at all games released between 2007 and the end of 2008, and comparing as many different configurations as possible – single format exclusives, handheld releases, Xbox 360, PS3 and Wii only – the research came to the same conclusion; marketing is more important than game quality. </p>
<p>You can read the entire speech at <a target = "_blank" href="http://www.gamesindustry.biz/articles/marketing-influences-game-revenue-three-times-more-than-high-scores">gamesindustry.biz</a> but what I would like to know is: do this apply to Flash games too?</p>
<p>First, let me say &#8220;marketing&#8221; is something different than just sending some emails to portal owners or submitting the game everywhere&#8230; it means using cash to make people know about your game.</p>
<p>I&#8217;ll talk later about cash, now I&#8217;ll focus on submitting the game everywhere&#8230; all in all submission takes time, so you are going to spend time to submit your game or to pay cash to someone willing to spend his time to submit your game everywhere.<span id="more-1980"></span></p>
<p><a href="http://www.emanueleferonato.com/2007/11/28/christmas-couples-the-finished-poux-prototype/"><strong>Christmas Couples</strong></a> really sucks, but I submitted it everywhere, and was one of the first games to include the <a href="http://www.mindjolt.com/" target="_blank">MindJolt</a> API. With its <strong>17,596,730</strong> views it was an incredible success.</p>
<p><a href="http://www.emanueleferonato.com/2008/03/04/experiment-monetizing-a-flash-game-part-8/"><strong>BallBalance</strong></a> was released a couple of months later, was <a href="http://www.emanueleferonato.com/2008/05/03/experiment-monetizing-a-flash-game-part-9/">featured on NewGrounds</a> so I let the viral distribution do the bulk work for me&#8230; it got &#8220;only&#8221; <strong>6,198,007</strong> views, than it&#8217;s about 1/3 of Christmas Couples views.</p>
<p>Let&#8217;s suppose both games have the same ECPM, we can say marketing made me earn three times more than quality.</p>
<p>But in Flash games there is an income source that does not exists in PC/Console games, excluding some minor cases&#8230; sponsorships.</p>
<p>BallBalance was sponsored by <a href="http://www.kongregate.com/?referrer=triqui">Kongregate</a> and <a href="http://www.addictinggames.com/">AddictingGames</a> and that&#8217;s where quality won over marketing.</p>
<p>Surely quality AND marketing would perform even better, but the entire point of this post is focused on spending less resources on quality and more on marketing.</p>
<p><strong>Pay to be featured</strong></p>
<p>Now, let&#8217;s talk about cash. Normally Flash game developers don&#8217;t pay to have their games featured. So the question is:</p>
<p>Would you pay to get featured on NewGrounds? I would.</p>
<p>Would you pay to get reviewed on JayIsGames? I would.</p>
<p>And the list could be much longer&#8230; obviously NG and JIG won&#8217;t feature lame jigsaw games because they would lose credibility, but let&#8217;s say I made a good game, and I would try to &#8220;help&#8221; it by &#8220;suggesting&#8221; some important sites to feature it&#8230; I really would.</p>
<p>And if you think this is not the right kind to make marketing&#8230; never mind&#8230; I would buy a review (or a featured spot) on important portals even if something says it was a paid submission, as long as the game is listed among other &#8220;free&#8221; games.</p>
<p>Do you?</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/GinFUb21xU8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/19/marketing-influences-game-revenue-three-times-more-than-high-scores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/19/marketing-influences-game-revenue-three-times-more-than-high-scores/</feedburner:origLink></item>
		<item>
		<title>HiRoads case study: building a community around a game</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/2kLnKCOW--A/</link>
		<comments>http://www.emanueleferonato.com/2009/11/18/hiroads-case-study-building-a-community-around-a-game/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 09:52:54 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Monetize]]></category>
		<category><![CDATA[Users contributions]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1974</guid>
		<description><![CDATA[With the so-called &#8220;Web 2.0&#8243; and the &#8220;social network era&#8221;, just making a game and publishing it on various portals couldn&#8217;t be enough.
Some days ago we saw how Bomb Digger allows to play extra levels on its official site, now it&#8217;s time to introduce you a more complete project.
Do you remember HiRoads developer Diary?
Now the [...]]]></description>
			<content:encoded><![CDATA[<p>With the so-called &#8220;Web 2.0&#8243; and the &#8220;social network era&#8221;, just making a game and publishing it on various portals couldn&#8217;t be enough.</p>
<p>Some days ago we saw how <a href="http://www.emanueleferonato.com/2009/11/12/bomb-digger-case-study-releasing-a-game-with-extra-features-if-played-on-the-official-site/">Bomb Digger</a> allows to play extra levels on its official site, now it&#8217;s time to introduce you a more complete project.</p>
<p>Do you remember <a href="http://www.emanueleferonato.com/2009/05/27/hiroads-developer-diary/">HiRoads developer Diary</a>?</p>
<p>Now the project is finished and <strong>Filippo Bodei</strong> is explaining us something about his work:</p>
<p>You can play the game on <a target = "_blank" href="http://www.hiroads.com/"><strong>HiRoads&#8217; official site</strong></a>.</p>
<p><a target = "_blank" href="http://www.hiroads.com/"><img src="http://www.emanueleferonato.com/wp-content/uploads/2009/11/hiroads.jpg" alt="HiRoads" title="HiRoads" /></a></p>
<p>&laquo; I published a demo version (something more than just a demo&#8230; 18 out of 27 levels) on Kongregate (rated 2.83) and NewGrounds (rated 3.70) with several ads inviting to play it on the official site where you can play more levels, create your own tracks with the level editor and play tracks submitted by users.<span id="more-1974"></span></p>
<p>During the first hours I noticed 50% of registered users created his own level.</p>
<p>The site is built around phpBB and every page checks if you are a logged user. Having an HiRoads account allows you to join the forum, to save created levels and to play new ones.</p>
<p>There is a database saving tracks completed by each player allowing to rate and review tracks submitted by other users. You can even keep a list of your favorite tracks or search for a specific one with several options such as difficulty, rating and so on.</p>
<p>Moreover, the site uses Facebook Connect to see tracks played by friends, to invite friends to play and to publish on your wall you just completed a track o created a new one.</p>
<p>The full 27 tracks game does not need any account creation to be played. &raquo;</p>
<p>Filippo said he will share some results in a month or two, meanwhile I wish him good luck for such a complete project.</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/2kLnKCOW--A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/18/hiroads-case-study-building-a-community-around-a-game/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/18/hiroads-case-study-building-a-community-around-a-game/</feedburner:origLink></item>
		<item>
		<title>Creation of a Flash Facebook application using AMFPHP</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/aNww-Kz1FTA/</link>
		<comments>http://www.emanueleferonato.com/2009/11/17/creation-of-a-flash-facebook-application-using-amfphp/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 01:29:05 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Users contributions]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1966</guid>
		<description><![CDATA[Some days ago I showed you how to create a Flash Facebook application using the AS3 API.
Now Yarden Refaeli from Rigel Games is sharing with us his experience in creating a Flash Facebook application using another technique.
Let&#8217;s read it:
&#171; Hello, my name is Yarden Refaeli and I have been flash programmer for 1 year. A [...]]]></description>
			<content:encoded><![CDATA[<p>Some days ago I showed you <a href="http://www.emanueleferonato.com/2009/11/04/creating-a-flash-facebook-application-with-the-facebook-actionscript-api/">how to create a Flash Facebook application using the AS3 API</a>.</p>
<p>Now <strong>Yarden Refaeli</strong> from <a href="http://www.rigelgames.com/" target="_blank"><strong>Rigel Games</strong></a> is sharing with us his experience in creating a Flash Facebook application using another technique.</p>
<p>Let&#8217;s read it:</p>
<p>&laquo; Hello, my name is <strong>Yarden Refaeli</strong> and I have been flash programmer for 1 year. A few weeks ago, I decided to make my first facebook flash game, <a href="http://apps.facebook.com/snaker-game" target= "_blank">Snaker</a>. Well, I won&#8217;t lie: It was HARD. After I made it to the end, I decided to write a tutorial about the best approach to build flash-facebook game. So let&#8217;s start! </p>
<p>First, we need to save our meta user-data about every user in OUR database, and for this we need to use a server-side language (in this tutorial I will talk about Mysql, but every other database or server-side language is fine). </p>
<p>Let&#8217;s say we want to make a game that save our score at the end, and then show us the score we got, and the scores of our friends. We need to save the score for every user, with it&#8217;s unique id, which can easily access through facebook APIs. Now lets say we want to do all the server-side jobs, with PHP and not flash: we don&#8217;t want to get the user-data we need from facebook-flash API, then send it all the way to the server and store it in the database, we want ALL the facebook/database related work, done on the server-side, with PHP. You should know, that you can access simple facebook library PHP code from flash, you need to authenticate first with the facebook function &#8220;set_user&#8221; with your user&#8217;s uid, and session key, that passed via the FBML tag in the flash vars. (for some strange reason, there is NO official documentation for this function AT ALL) <span id="more-1966"></span></p>
<p>Now, flash needs to communicate with the server-side (POST requests for example). We can build our own dandy classes in PHP and AS3 (as I did in the beginning), but why? We shouldn&#8217;t spend precious time on this task when we have AMFPHP! </p>
<p><a href="http://www.amfphp.org/" target="_blank"><strong>AMFPHP</strong></a> is a great open-source tool that allow flash to communicate with the server-side in a few lines of code! All you need to do, is of course, write the server-side functions, and then you can call it from your SWF, with Actionscript 3. </p>
<p>For example, if we want to get the user&#8217;s name from the server (using PHP and Facebook PHP-Platform), we need to create the following PHP class:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> HiWorld <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$facebook</span>;
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> HiWorld<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">include</span> <span style="color: #0000ff;">&quot;path/to/facebook/PHP/platform&quot;</span>;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sayHi<span style="color: #009900;">&#40;</span><span style="color: #000088;">$uid</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sessionKey</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$appapikey</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;fefcc99d6c09e56d9330d3d8e9e1d30a&quot;</span>;
		<span style="color: #000088;">$appsecret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;eb5680d5137ba850487984ac75d97583&quot;</span>;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">facebook</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Facebook<span style="color: #009900;">&#40;</span><span style="color: #000088;">$appapikey</span><span style="color: #339933;">,</span> <span style="color: #000088;">$appsecret</span><span style="color: #009900;">&#41;</span>;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_user</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uid</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sessionKey</span><span style="color: #009900;">&#41;</span>;
&nbsp;
		<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">users_getInfo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$uid</span><span style="color: #339933;">,</span> <span style="">'name'</span><span style="color: #009900;">&#41;</span>;
		<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$name</span><span style="color: #009900;">&#91;</span><span style="color:#800080;">0</span><span style="color: #009900;">&#93;</span>;
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;Hi,&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$name</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;, how do you do?&quot;</span>;					
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>And save it in the &#8220;services&#8221; directory of AMFPHP, on our server. Now all we need to do is to call this function from our Actionscript 3 code, like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="actionscript3 actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #009900;">// required for flash file and output display</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">MovieClip</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> fl.events.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #009900;">// required to send/recieve data over AMF</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">NetConnection</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #004993;">Responder</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main extends <span style="color: #004993;">MovieClip</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> gateway<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;path/to/gateway.php&quot;</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> connection<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">NetConnection</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> responder<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Responder</span>;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> response_text<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>;
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// Responder to handle data returned from AMFPHP.</span>
			<span style="color: #0033ff; font-weight: bold;">this</span>.responder = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Responder</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>.onResult<span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">this</span>.connection = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">NetConnection</span>;
			<span style="color: #009900;">// Gateway.php url for NetConnection</span>
			<span style="color: #0033ff; font-weight: bold;">this</span>.connection.<span style="color: #004993;">connect</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>.gateway<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">this</span>.respond_text = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>.response_txt<span style="color: #000000;">&#41;</span>;
&nbsp;
			<span style="color: #009900;">// Get the auth vars from the flash vars</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> sessionKey<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">LoaderInfo</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>._root.<span style="color: #004993;">loaderInfo</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">parameters</span>.fb_sig_session_key;
			<span style="color: #6699cc; font-weight: bold;">var</span> uid<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #004993;">LoaderInfo</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span>._root.<span style="color: #004993;">loaderInfo</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">parameters</span>.fb_sig_user;
&nbsp;
			<span style="color: #009900;">// call remote function</span>
			<span style="color: #0033ff; font-weight: bold;">this</span>.connection.<span style="color: #004993;">call</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;HiWorld.sayHi&quot;</span>, responder, uid, sessionKey<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #009900;">// Handle an AMF call. This method is defined by the responder. </span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> onResult<span style="color: #000000;">&#40;</span>result<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">this</span>.response_txt.<span style="color: #004993;">text</span> = <span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>result<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>In this tutorial, we use the NetConnection class to connect flash and PHP. Actually, the NetConnect is more like the &#8220;pipe&#8221; between them, as all the data passed with it. The first parameter for the &#8220;connect&#8221; method of our connection object, is the className.function to call, the second is the responder object, and the others are the parameters for the function. When you call the remote function, you can pass as many parameters to PHP as the function require. The responder is an object with a reference to a function, (simple and stupid ;) ) that will be invoked when the request completed. When we get the data from the server, the &#8220;onResult&#8221; function called, with the result parameter. The result paramter is an object that the server returned. Our function simply cast it to string and put it in our text field. </p>
<p>Note: AMFPHP is also ENCRYPT the data sent (vice-versa), and automatically decrypt it as well in the other side.</p>
<p>This way, we can access all the data that facebook supply&#8230; Now only the skies are the real limit&#8230; This is what I&#8217;ve done in snaker (Actually, I&#8217;ve built a Highscore class in AS, that handle all the highscore and facebook related data). </p>
<p>This was my first tutorial ever about AMFPHP and facebook! Feel free to send me feedback to yard2010[at]gmail[dot]com! I hope you learned something new =] </p>
<p>All the code above most be in it&#8217;s appropriate place: PHP on compatible server, and the SWF must run only in a facebook canvas page with the fb:swf FBML tag! &raquo;</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/aNww-Kz1FTA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/17/creation-of-a-flash-facebook-application-using-amfphp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/17/creation-of-a-flash-facebook-application-using-amfphp/</feedburner:origLink></item>
		<item>
		<title>Triqui’s Picks #5</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/5zz-ABybEb4/</link>
		<comments>http://www.emanueleferonato.com/2009/11/16/triquis-picks-5/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 11:43:12 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1957</guid>
		<description><![CDATA[This was a great week for Flash gamers, here it is a list of really really great  games.
The best picks so far, in my opinion. You&#8217;ll really enjoy these ones.
B.C. Bow Contest: Great bow game with a prehistoric theme&#8230; win all tournaments using several kinds of arrows
What I liked: Everything, great Nitrome game, as [...]]]></description>
			<content:encoded><![CDATA[<p>This was a great week for Flash gamers, here it is a list of really really great  games.</p>
<p>The best picks so far, in my opinion. You&#8217;ll really enjoy these ones.</p>
<p><a href="http://www.triqui.com/2009/11/13/b-c-bow-contest/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/b_c_-bow-contest/_thumb_100x100.jpg" title="B.C. Bow Contest" /></a><a href="http://www.triqui.com/2009/11/13/b-c-bow-contest/" target = "_blank"><strong>B.C. Bow Contest</strong></a>: Great bow game with a prehistoric theme&#8230; win all tournaments using several kinds of arrows</p>
<p><strong>What I liked</strong>: Everything, great Nitrome game, as usual</p>
<p><strong>Programming difficulty</strong>: The hardest part is the physics behind arrows&#8230; <strong>3/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/13/cannon-bods-2009/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/cannon-bods-2009/_thumb_100x100.jpg" title="Cannon Bods 2009" /></a><a href="http://www.triqui.com/2009/11/13/cannon-bods-2009/" target = "_blank"><strong>Cannon Bods 2009</strong></a>: Kill parachuting pirates with your Bod, using one or more cannons</p>
<p><strong>What I liked</strong>: it&#8217;s a funny game&#8230;</p>
<p><strong>Programming difficulty</strong>: I think there is a glitch if you shoot too close to a pirate, your Bod won&#8217;t hit him&#8230; :( <strong>1/5</strong><span id="more-1957"></span></p>
<p><a href="http://www.triqui.com/2009/11/13/dawn-of-the-bod-2009/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/dawn-of-the-bod-2009/_thumb_100x100.jpg" title="Dawn of the Bod 2009" /></a><a href="http://www.triqui.com/2009/11/13/dawn-of-the-bod-2009/" target = "_blank"><strong>Dawn of the Bod 2009</strong></a>: Bods return in this horror game&#8230; kill all Bods shooting at their heads</p>
<p><strong>What I liked</strong>: finally a cute splatter game</p>
<p><strong>Programming difficulty</strong>: just some hit tests. <strong>1/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/10/wake-up-the-box/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/wake-up-the-box/_thumb_100x100.jpg" title="Wake Up the Box" /></a><a href="http://www.triqui.com/2009/11/10/wake-up-the-box/" target = "_blank"><strong>Wake Up the Box</strong></a>: Great physics game&#8230; wake up a sleeping box in this puzzle game</p>
<p><strong>What I liked</strong>: Great concept&#8230; really nice</p>
<p><strong>Programming difficulty</strong>: physics joints aren&#8217;t programmer&#8217;s best friends&#8230; <strong>4/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/09/night-balloons/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/night-balloons/_thumb_100x100.jpg" title="Night Balloons" /></a><a href="http://www.triqui.com/2009/11/09/night-balloons/" target = "_blank"><strong>Night Balloons</strong></a>: Catch the balloons with your hook without popping them, don&#8217;t kill butterflies.</p>
<p><strong>What I liked</strong>: A game with balloons, and you don&#8217;t have to pop them&#8230;</p>
<p><strong>Programming difficulty</strong>: see something similar <a href="http://www.emanueleferonato.com/2008/10/04/create-a-flash-game-like-gold-miner/">here</a>. <strong>2/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/09/helio-adventures-reloaded/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/helio-adventures-reloaded/_thumb_100x100.jpg" title="Helio Adventures Reloaded" /></a><a href="http://www.triqui.com/2009/11/09/helio-adventures-reloaded/" target = "_blank"><strong>Helio Adventures Reloaded</strong></a>: Sequel of <a href="http://www.triqui.com/2009/10/15/helio-adventures/" target ="_blank">Helio Adventures</a> already featured on <a href="http://www.emanueleferonato.com/2009/10/18/triquis-picks-1/">Triqui&#8217;s Picks #1</a>.</p>
<p><strong>What I liked</strong>: the graphics and the level design</p>
<p><strong>Programming difficulty</strong>: Not that harder than the original&#8230; just a couple of new features like fans <strong>2/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/09/galaxy-wars-for-the-sake-of-the-universe/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/galaxy-wars-for-the-sake-of-the-universe/_thumb_100x100.png" title="Galaxy Wars: for the Sake of the Universe" /></a><a href="http://www.triqui.com/2009/11/09/galaxy-wars-for-the-sake-of-the-universe/" target = "_blank"><strong>Galaxy Wars: for the Sake of the Universe</strong></a>: Really interesting space adventure claiming &#8220;a unique control scheme that puts a new spin on a classic genre&#8221;, but you can see the concept in <a href="http://www.emanueleferonato.com/2007/09/29/build-a-game-like-sproing-with-flash/">Build a game like Sproing with Flash</a>.</p>
<p><strong>What I liked</strong>: The graphics!!!!!!!!</p>
<p><strong>Programming difficulty</strong>: Not that hard, not that unique&#8230; <strong>3/5</strong></p>
<p>See you next week</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/5zz-ABybEb4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/16/triquis-picks-5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/16/triquis-picks-5/</feedburner:origLink></item>
		<item>
		<title>Bomb Digger case study: releasing a game with extra features if played on the official site</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/H3kzLijsVzQ/</link>
		<comments>http://www.emanueleferonato.com/2009/11/12/bomb-digger-case-study-releasing-a-game-with-extra-features-if-played-on-the-official-site/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 17:58:39 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Monetize]]></category>
		<category><![CDATA[Users contributions]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1951</guid>
		<description><![CDATA[How many games have you played around the web allowing you to play only the first levels unless you play them on the official site?
I always wondered how people react to this feature, that can be quite an interesting way to drive traffic to your site, where you surely placed a lot of ads.
This is [...]]]></description>
			<content:encoded><![CDATA[<p>How many games have you played around the web allowing you to play only the first levels unless you play them on the official site?</p>
<p>I always wondered how people react to this feature, that can be quite an interesting way to drive traffic to your site, where you surely placed a lot of ads.</p>
<p>This is the story of <strong>Alexander V. Trukhin</strong> and his first Flash game, <a target = "_blank" href="http://bombdigger.com/"><strong>Bomb Digger</strong></a></p>
<p><a target = "_blank" href="http://bombdigger.com/"><img src="http://www.emanueleferonato.com/wp-content/uploads/2009/11/bombdigger.jpg" alt="bombdigger" title="bombdigger" /></a></p>
<p>It is remake of old Boulder Dash style game, inspired by old ZX Spectrum <a target = "_blank" href="http://www.youtube.com/watch?v=bBFFw3_JTJc">Down to Earth</a> game.</p>
<p>Alexander loved this game, made a remake, designing his own levels and graphics.</p>
<p>Talking about level design, Alexander is afraid the game is too hard&#8230; anyway this is his experience:<span id="more-1951"></span></p>
<p>&laquo; People say some portals don&#8217;t like limited versions, and maybe full version might have a more successful distribution. Unfortunately I learned it after distribution already started&#8230;</p>
<p>The idea was allowing players to play only demo levels unless they play the game on the official site. It was my mistake.</p>
<p>The game was found too hard for most people&#8230; Only 4 players of 155 score submitters passed demo levels!</p>
<p>So, most of them had no reason to go and play it on the official site.</p>
<p>Many players lost all lifes in demo levels, it is absolutely impossible to understand&#8230; I have several interesting levels for a sequel, but with nobody who can pass them, I think&#8230; :)</p>
<p>I have 500 plays and 50-60 visitors to my site per day.</p>
<p>I think about 1000 site visitors per day would be good result. I have ideas about new levels and features, but I think it have sense to make a sequel only if first version will be successful.</p>
<p>Inspiration comes from <a target = "_blank" href="http://www.handdrawngames.com">handdrawngames.com</a> &#8211; they have a site with several versions and a community.</p>
<p>The plan was to make versions 2, 3, and so on&#8230; with new levels and features, but if people can&#8217;t pass learning levels&#8230;</p>
<p>Eh, in &#8220;eighties&#8221; players were more&#8230; hardcore.</p>
<p>And a bit about programming.</p>
<p>I had a problem with perfomance when I tried to make first prototypes.</p>
<p>First prototype used an object for each non-empty cell in the game field. It worked well for small one-screen (15&#215;15) fields, but I wanted to use large levels with scrolling.</p>
<p>Optimization included:</p>
<p>- Painting unmovable objects as static graphics (bitmap): walls, green area<br />
- All objects are objects, but also use bitmaps and their rotation is simply rotation of clips<br />
- Destroying static objects painting a black square over them (some bugs exist&#8230;)</p>
<p>Maximum field size is 96&#215;96 = 2880/30 (cell size). It is enough and I don&#8217;t need to use several blocks.</p>
<p>Unlike all Boulder Dash games I saw, there is smooth movement of objects instead &#8216;jumps&#8217; from cell to cell.</p>
<p>At a first sight it wasn&#8217;t a problem, but it requied to remake collision algorithm.</p>
<p>I think it looks significantly better.</p>
<p>All in all the game engine is quite simply: array maps, <code>onEnterFrame</code> loop for all movable objects and many small codes for each type of object to describe its behavior.</p>
<p>P.S. The interesting fact is I had no ActionScript experience and first prototype was written using JavaScipt and worked in a browser. :)</p>
<p>Porting to Flash worked without big changes (except small input and output functions). &raquo;</p>
<p>What&#8217;s your experience with games fully playable only on their official site?</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/H3kzLijsVzQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/12/bomb-digger-case-study-releasing-a-game-with-extra-features-if-played-on-the-official-site/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/12/bomb-digger-case-study-releasing-a-game-with-extra-features-if-played-on-the-official-site/</feedburner:origLink></item>
		<item>
		<title>Creating a Flash Facebook application with the Facebook Actionscript API – part 2</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/DbcA3vixIxo/</link>
		<comments>http://www.emanueleferonato.com/2009/11/11/creating-a-flash-facebook-application-with-the-facebook-actionscript-api-part-2/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 17:16:09 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1949</guid>
		<description><![CDATA[It&#8217;s time to make some considerations on the Facebook application made with the Facebook Actionscript API I blogged some days ago.
There was a doubt about putting a secret key in the swf file.
Well, you should never give away your secret key, but let me point on two things:
1) You can encrypt your swf file, obfuscating [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s time to make some considerations on the <a href="http://www.emanueleferonato.com/2009/11/04/creating-a-flash-facebook-application-with-the-facebook-actionscript-api/">Facebook application made with the Facebook Actionscript API</a> I blogged some days ago.</p>
<p>There was a doubt about putting a secret key in the <code>swf</code> file.</p>
<p>Well, <strong>you should never give away your secret key</strong>, but let me point on two things:</p>
<p>1) You can encrypt your <code>swf</code> file, obfuscating the secret key&#8230; and just in case you think nothing is encrypted enough&#8230; surprise&#8230;</p>
<p>2) <strong>My Facebook application works without api and secret keys</strong>. That&#8217;s it&#8230; I tested it with more than one account, and everybody was able to use the application even if my keys are stored this way:</p>
<p><code>var api_key:String="xxxxxxxxxxxxxxxxxxxxxxx";<br />
var secret_key:String="yyyyyyyyyyyyyyyyyyyyyyy";</code></p>
<p>I am not hiding them, they are really a series of <code>x</code> and <code>y</code>&#8230; probably when you render a <code>swf</code> in <code>canvas</code> mode, they aren&#8217;t mandatory.</p>
<p>I have to say, I did not find docs about it, so take it as it comes.</p>
<p>The feature introduce this time is showing all your friends&#8230; there was a reader that was unable to populate a list with friend names, so here it is.</p>
<p>I didn&#8217;t create any list, but I&#8217;m simply showing them in a text area.<span id="more-1949"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
</pre></td><td class="code"><pre class="actionscript3 actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> fl.controls.Button;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span>.<span style="color: #004993;">TextField</span>;
	<span style="color: #009900;">// facebook libraries</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.Facebook;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.utils.FacebookSessionUtil;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.commands.notifications.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.commands.friends.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.commands.stream.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.commands.users.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.events.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.<span style="color: #004993;">data</span>.users.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.<span style="color: #004993;">data</span>.friends.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> com.facebook.net.FacebookCall;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> facebook_demo extends <span style="color: #004993;">Sprite</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> vars_field<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>=<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span>  ;
		<span style="color: #6699cc; font-weight: bold;">var</span> friends_field<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">TextField</span>=<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">TextField</span>  ;
		<span style="color: #6699cc; font-weight: bold;">var</span> my_button<span style="color: #000000; font-weight: bold;">:</span>Button;
		<span style="color: #6699cc; font-weight: bold;">var</span> fbook<span style="color: #000000; font-weight: bold;">:</span>Facebook;
		<span style="color: #009900;">// these are the api and secret keys you should be used to</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> api_key<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>=<span style="color: #990000;">&quot;xxxxxxxxxxxxxxxxxxxxxxx&quot;</span>;
		<span style="color: #6699cc; font-weight: bold;">var</span> secret_key<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>=<span style="color: #990000;">&quot;yyyyyyyyyyyyyyyyyyyyyyy&quot;</span>;
		<span style="color: #009900;">// starting a new facebook session</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> fb_session<span style="color: #000000; font-weight: bold;">:</span>FacebookSessionUtil=<span style="color: #0033ff; font-weight: bold;">new</span> FacebookSessionUtil<span style="color: #000000;">&#40;</span>api_key,secret_key,<span style="color: #004993;">loaderInfo</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">// in this object I will store all variables Facebook will pass to the movie</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> passed_vars<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Object</span>;
		<span style="color: #009900;">// this variable will hold all facebook API calls</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> fbcall<span style="color: #000000; font-weight: bold;">:</span>FacebookCall;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> facebook_demo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// just placing some buttons...</span>
			place_buttons<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// just creating a text field...</span>
			create_vars_field<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// initializing the session</span>
			fbook=fb_session.facebook;
			<span style="color: #009900;">// this function will just print out all variables Facebook is passing to the movie</span>
			get_vars<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// getting friends uids (unique ids)</span>
			fbcall = <span style="color: #0033ff; font-weight: bold;">new</span> GetFriends<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			fbook.post<span style="color: #000000;">&#40;</span>fbcall<span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// function on_get_friends will be called once the post is completed</span>
			fbcall.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>FacebookEvent.<span style="color: #004993;">COMPLETE</span>, on_get_friends<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">// function to be called after GetFriends has finished</span>
		<span style="color: #339966; font-weight: bold;">function</span> on_get_friends<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span>FacebookEvent<span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> friends = <span style="color: #000000;">&#40;</span>e.<span style="color: #004993;">data</span> <span style="color: #0033ff; font-weight: bold;">as</span> GetFriendsData<span style="color: #000000;">&#41;</span>.friends;
			<span style="color: #6699cc; font-weight: bold;">var</span> friends_num<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=friends.<span style="color: #004993;">length</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> uids<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// loading all friends uids into an array</span>
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=0; i<span style="color: #000000; font-weight: bold;">&lt;</span>friends_num; i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> user=friends.getItemAt<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span> <span style="color: #0033ff; font-weight: bold;">as</span> FacebookUser;
				uids.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>user.uid<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #009900;">// retrieving informations for all uids contained in the uids array</span>
			fbcall=<span style="color: #0033ff; font-weight: bold;">new</span> GetInfo<span style="color: #000000;">&#40;</span>uids,<span style="color: #000000;">&#91;</span>GetInfoFieldValues.ALL_VALUES<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
			fbook.post<span style="color: #000000;">&#40;</span>fbcall<span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// the function on_friend_list_loaded will be called once the post is completed</span>
			fbcall.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span>FacebookEvent.<span style="color: #004993;">COMPLETE</span>, on_friend_list_loaded<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">// function to be called after GetInfo has finished</span>
		<span style="color: #339966; font-weight: bold;">function</span> on_friend_list_loaded<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span>FacebookEvent<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> friends_data = <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>e.<span style="color: #004993;">data</span> <span style="color: #0033ff; font-weight: bold;">as</span> GetInfoData<span style="color: #000000;">&#41;</span>.userCollection<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> friends_num=friends_data.<span style="color: #004993;">length</span>;
			<span style="color: #009900;">// scanning all friends array and printing name and last name of each one</span>
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=0; i<span style="color: #000000; font-weight: bold;">&lt;</span>friends_num; i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #6699cc; font-weight: bold;">var</span> user=friends_data.getItemAt<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span>;
				friends_field.<span style="color: #004993;">appendText</span><span style="color: #000000;">&#40;</span>user.first_name<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot; &quot;</span><span style="color: #000000; font-weight: bold;">+</span>user.last_name<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;<span style="">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">// this is the core function, the one that will handle clicks on buttons and publising notes or stories according</span>
		<span style="color: #009900;">// to the button I am pressing</span>
		<span style="color: #339966; font-weight: bold;">function</span> onclick<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// retrieving the user id (it's one of the variables passed by Facebook)</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> uid<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #004993;">Number</span><span style="color: #000000;">&#40;</span>passed_vars<span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;fb_sig_user&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">switch</span> <span style="color: #000000;">&#40;</span>event.<span style="color: #004993;">currentTarget</span>.label<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Publish a note&quot;</span> <span style="color: #000000; font-weight: bold;">:</span>
					<span style="color: #009900;">// publishing a note</span>
					fbcall=<span style="color: #0033ff; font-weight: bold;">new</span> SendNotification<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>uid<span style="color: #000000;">&#93;</span>,<span style="color: #990000;">&quot;just sent a self-notification using &lt;a href = <span style="">\&quot;</span>http://apps.facebook.com/flash_demo/<span style="">\&quot;</span>&gt;Facebook Flash Demo&lt;/a&gt;&quot;</span>,<span style="color: #990000;">&quot;user_to_user&quot;</span><span style="color: #000000;">&#41;</span>;
					fbook.post<span style="color: #000000;">&#40;</span>fbcall<span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
				<span style="color: #0033ff; font-weight: bold;">case</span> <span style="color: #990000;">&quot;Publish a story&quot;</span> <span style="color: #000000; font-weight: bold;">:</span>
					<span style="color: #009900;">// publishing a story</span>
					fbcall=<span style="color: #0033ff; font-weight: bold;">new</span> PublishPost<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;is using Facebook Flash Demo&quot;</span>,<span style="color: #000000;">&#123;</span><span style="color: #990000;">'href'</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">'http://apps.facebook.com/flash_demo/'</span>,<span style="color: #990000;">'name'</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">'Facebook Flash Demo'</span>,<span style="color: #990000;">'description'</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">'that<span style="">\'</span>s it'</span>,<span style="color: #990000;">'caption'</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">'this image was published by a Flash Movie'</span>,<span style="color: #990000;">'media'</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#123;</span><span style="color: #990000;">'type'</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">'image'</span>,<span style="color: #990000;">'src'</span><span style="color: #000000; font-weight: bold;">:</span>  <span style="color: #990000;">'http://www.gamemummy.com/facebook/flash_demo/api.jpg'</span>, <span style="color: #990000;">'href'</span><span style="color: #000000; font-weight: bold;">:</span> <span style="color: #990000;">'http://apps.facebook.com/flash_demo/'</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#123;</span><span style="color: #990000;">'href'</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">'http://apps.facebook.com/flash_demo/'</span>,<span style="color: #990000;">'text'</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #990000;">'Visit Facebook Flash Demo'</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#93;</span>,uid.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
					fbook.post<span style="color: #000000;">&#40;</span>fbcall<span style="color: #000000;">&#41;</span>;
					<span style="color: #0033ff; font-weight: bold;">break</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #339966; font-weight: bold;">function</span> create_vars_field<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>vars_field<span style="color: #000000;">&#41;</span>;
			vars_field.<span style="color: #004993;">width</span>=<span style="color: #000000; font-weight:bold;">340</span>;
			vars_field.<span style="color: #004993;">height</span>=<span style="color: #000000; font-weight:bold;">320</span>;
			vars_field.<span style="color: #004993;">x</span>=0;
			vars_field.<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">10</span>;
			vars_field.<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;DEFAULT VARS PASSED BY FACEBOOK:<span style="">\n</span><span style="">\n</span>&quot;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>friends_field<span style="color: #000000;">&#41;</span>;
			friends_field.<span style="color: #004993;">width</span>=<span style="color: #000000; font-weight:bold;">340</span>;
			friends_field.<span style="color: #004993;">height</span>=<span style="color: #000000; font-weight:bold;">320</span>;
			friends_field.<span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">350</span>;
			friends_field.<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">10</span>;
			friends_field.<span style="color: #004993;">text</span>=<span style="color: #990000;">&quot;YOUR FACEBOOK FRIENDS (scroll with mousewheel):<span style="">\n</span><span style="">\n</span>&quot;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #339966; font-weight: bold;">function</span> get_vars<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> varname<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> varvalue<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span>;
			passed_vars=<span style="color: #004993;">root</span>.<span style="color: #004993;">loaderInfo</span>.<span style="color: #004993;">parameters</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span>varname <span style="color: #0033ff; font-weight: bold;">in</span> passed_vars<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				varvalue=<span style="color: #004993;">String</span><span style="color: #000000;">&#40;</span>passed_vars<span style="color: #000000;">&#91;</span>varname<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>;
				vars_field.<span style="color: #004993;">appendText</span><span style="color: #000000;">&#40;</span>varname<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;:<span style="">\t</span>&quot;</span><span style="color: #000000; font-weight: bold;">+</span>varvalue<span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;<span style="">\n</span>&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #339966; font-weight: bold;">function</span> place_buttons<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> bnames<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span>=<span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;Publish a note&quot;</span>,<span style="color: #990000;">&quot;Publish a story&quot;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=0; i<span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000; font-weight:bold;">2</span>; i<span style="color: #000000; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				my_button=<span style="color: #0033ff; font-weight: bold;">new</span> Button  ;
				<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>my_button<span style="color: #000000;">&#41;</span>;
				my_button.label=bnames<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>;
				my_button.move<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">225</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">150</span><span style="color: #000000; font-weight: bold;">*</span>i,<span style="color: #000000; font-weight:bold;">350</span><span style="color: #000000;">&#41;</span>;
				my_button.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">CLICK</span>,onclick<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>The result as usual is on the <a target = "_blank" href="http://apps.facebook.com/flash_demo/">application page</a> and there is no need to download anything since you can just try it by just cutting/pasting the code on the example you can find at <a href="http://www.emanueleferonato.com/2009/11/04/creating-a-flash-facebook-application-with-the-facebook-actionscript-api/">this link</a>.</p>
<p>Can you all make the application work without api and secret keys?</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/DbcA3vixIxo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/11/creating-a-flash-facebook-application-with-the-facebook-actionscript-api-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/11/creating-a-flash-facebook-application-with-the-facebook-actionscript-api-part-2/</feedburner:origLink></item>
		<item>
		<title>Creation of a Flash Stabilize! clone using Box2D – part 3</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/O64u7mZsk6g/</link>
		<comments>http://www.emanueleferonato.com/2009/11/10/creation-of-a-flash-stabilize-clone-using-box2d-%e2%80%93-part-3/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 14:24:58 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[Box2D]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1943</guid>
		<description><![CDATA[Here we are with the 3rd step.
Read steps 1 and 2, then continue with this post.
One thing I missed in Stabilize! was the &#8220;next&#8221; feature, something showing the block we are going do drop after the current one.
The first time I saw this feature was in Tetris&#8230; now try to imagine yourself playing Tetris without [...]]]></description>
			<content:encoded><![CDATA[<p>Here we are with the 3rd step.</p>
<p>Read steps <a href="http://www.emanueleferonato.com/2009/10/26/creation-of-a-flash-stabilize-clone-using-box2d-part-1/">1</a> and <a href="http://www.emanueleferonato.com/2009/10/29/creation-of-a-flash-stabilize-clone-using-box2d-part-2/">2</a>, then continue with this post.</p>
<p>One thing I missed in <a target = "_blank" href="http://www.triqui.com/2009/10/10/stabilize/">Stabilize!</a> was the &#8220;next&#8221; feature, something showing the block we are going do drop after the current one.</p>
<p>The first time I saw this feature was in Tetris&#8230; now try to imagine yourself playing Tetris without the &#8220;next&#8221; piece displayed somewhere on the screen. What a lack of strategy!!</p>
<p>So we are going to introduce the &#8220;next&#8221; feature in this game.</p>
<p>In order to do this, we must have different crates. So now each crate has a random color (from 1 to 5) and a random weight (from 1 to 9).</p>
<p>The principle of this feature is to randomly generate both the current and the next crate when we start the game, and give the player the current one.</p>
<p>When the player drops the current crate, give him the previously generated &#8220;next&#8221; one and randomly generate the next &#8220;next&#8221; one, that will be given to the player once he drops the old &#8220;next&#8221; one, and so on.<span id="more-1943"></span></p>
<p>So here it is the commented script:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
</pre></td><td class="code"><pre class="actionscript3 actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span>.<span style="color: #004993;">Sprite</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">Event</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #004993;">MouseEvent</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> Box2D.Dynamics.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> Box2D.Collision.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> Box2D.Collision.Shapes.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">import</span> Box2D.Common.<span style="color: #004993;">Math</span>.<span style="color: #000000; font-weight: bold;">*</span>;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> stabilize extends <span style="color: #004993;">Sprite</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> m_sprite<span style="color: #000000; font-weight: bold;">:</span> <span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> m_world<span style="color: #000000; font-weight: bold;">:</span>b2World;
		<span style="color: #009900;">// the_crate is the crate sprite</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> the_crate<span style="color: #000000; font-weight: bold;">:</span>crate=<span style="color: #0033ff; font-weight: bold;">new</span> crate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">// next_crate</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> next_crate<span style="color: #000000; font-weight: bold;">:</span>crate=<span style="color: #0033ff; font-weight: bold;">new</span> crate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">// droppable_area is the sprite representing the area your mouse</span>
		<span style="color: #009900;">// must overlap to drop a crate</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> droppable_area<span style="color: #000000; font-weight: bold;">:</span>drop_area = <span style="color: #0033ff; font-weight: bold;">new</span> drop_area<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">// this is the weight of the current crate I am dropping</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> cur_drop<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #004993;">Math</span>.<span style="color: #004993;">ceil</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">// this is the color of the current crate I am dropping</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> cur_color<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #004993;">Math</span>.<span style="color: #004993;">ceil</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #009900;">// weight and color of &quot;next&quot; crate</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> next_drop<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #004993;">Math</span>.<span style="color: #004993;">ceil</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> next_color<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #004993;">Math</span>.<span style="color: #004993;">ceil</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> stabilize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> gravity<span style="color: #000000; font-weight: bold;">:</span>b2Vec2=<span style="color: #0033ff; font-weight: bold;">new</span> b2Vec2<span style="color: #000000;">&#40;</span>0,<span style="color: #000000; font-weight:bold;">9.8</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> worldAABB<span style="color: #000000; font-weight: bold;">:</span>b2AABB = <span style="color: #0033ff; font-weight: bold;">new</span> b2AABB<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			worldAABB.lowerBound.Set<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1000</span>,<span style="color: #000000; font-weight: bold;">-</span><span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span>;
			worldAABB.upperBound.Set<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1000</span>,<span style="color: #000000; font-weight:bold;">1000</span><span style="color: #000000;">&#41;</span>;
			m_world=<span style="color: #0033ff; font-weight: bold;">new</span> b2World<span style="color: #000000;">&#40;</span>worldAABB,gravity,<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			m_sprite = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>m_sprite<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>droppable_area<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>the_crate<span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// assigning the crate current weight and color</span>
			the_crate.weight.<span style="color: #004993;">text</span>=cur_drop.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			the_crate.<span style="color: #004993;">gotoAndStop</span><span style="color: #000000;">&#40;</span>cur_color<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>next_crate<span style="color: #000000;">&#41;</span>;
			<span style="color: #009900;">// assigning &quot;next&quot; crate weight and color</span>
			next_crate.weight.<span style="color: #004993;">text</span>=next_drop.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			next_crate.<span style="color: #004993;">gotoAndStop</span><span style="color: #000000;">&#40;</span>next_color<span style="color: #000000;">&#41;</span>;
			next_crate.<span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">250</span>;
			next_crate.<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">385</span>;
			debug_draw<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			AddBox<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">250</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">350</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,0,<span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span>;
			AddBox<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">250</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">350</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">200</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">20</span>,<span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">ENTER_FRAME</span>,Update<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_DOWN</span>,mousePressed<span style="color: #000000;">&#41;</span>;
			<span style="color: #004993;">stage</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">MouseEvent</span>.<span style="color: #004993;">MOUSE_MOVE</span>,mouseMoved<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> mousePressed<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #009900;">// look at hitTestPoint... the final true value says it's going to to check against the actual pixels</span>
			<span style="color: #009900;">// instead of the bounding box</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>droppable_area.<span style="color: #004993;">hitTestPoint</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">mouseX</span>,<span style="color: #004993;">mouseY</span>,<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #009900;">// notice the cur_drop parameter, I am passing the weight of the current crate to the AddBox function</span>
				AddBox<span style="color: #000000;">&#40;</span><span style="color: #004993;">mouseX</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #004993;">mouseY</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">0.5</span>,<span style="color: #000000; font-weight:bold;">0.5</span>,cur_drop,<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> mouseMoved<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">MouseEvent</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			the_crate.<span style="color: #004993;">x</span>=<span style="color: #004993;">mouseX</span>;
			the_crate.<span style="color: #004993;">y</span>=<span style="color: #004993;">mouseY</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>droppable_area.<span style="color: #004993;">hitTestPoint</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">mouseX</span>,<span style="color: #004993;">mouseY</span>,<span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				the_crate.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">1</span>;
			<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
				the_crate.<span style="color: #004993;">alpha</span>=<span style="color: #000000; font-weight:bold;">0.5</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #009900;">// function AddBox</span>
		<span style="color: #009900;">// px: x position</span>
		<span style="color: #009900;">// py: y position</span>
		<span style="color: #009900;">// _halfwidth: half of the box width</span>
		<span style="color: #009900;">// _halfheight: half of the box height</span>
		<span style="color: #009900;">// density: density of the box (0: static)</span>
		<span style="color: #009900;">// is_crate: if true, it's a crate (and you should render the proper movieclip</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> AddBox<span style="color: #000000;">&#40;</span>px<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>,py<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>,_halfwidth<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>,_halfheight<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>,density<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Number</span>,is_crate<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Boolean</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> bodyDef<span style="color: #000000; font-weight: bold;">:</span>b2BodyDef = <span style="color: #0033ff; font-weight: bold;">new</span> b2BodyDef<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			bodyDef.<span style="color: #004993;">position</span>.Set<span style="color: #000000;">&#40;</span>px,py<span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> boxDef<span style="color: #000000; font-weight: bold;">:</span>b2PolygonDef = <span style="color: #0033ff; font-weight: bold;">new</span> b2PolygonDef<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			boxDef.SetAsBox<span style="color: #000000;">&#40;</span>_halfwidth,_halfheight<span style="color: #000000;">&#41;</span>;
			boxDef.density=density;
			boxDef.friction=<span style="color: #000000; font-weight:bold;">0.3</span>;
			boxDef.restitution=<span style="color: #000000; font-weight:bold;">0.2</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>is_crate<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				bodyDef.userData = <span style="color: #0033ff; font-weight: bold;">new</span> crate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> body<span style="color: #000000; font-weight: bold;">:</span>b2Body=m_world.CreateBody<span style="color: #000000;">&#40;</span>bodyDef<span style="color: #000000;">&#41;</span>;
			body.CreateShape<span style="color: #000000;">&#40;</span>boxDef<span style="color: #000000;">&#41;</span>;
			body.SetMassFromShapes<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>is_crate<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>bodyDef.userData<span style="color: #000000;">&#41;</span>;
				<span style="color: #009900;">// assigning current weight and color to the Box2D sprite bound to the box I created</span>
				bodyDef.userData.weight.<span style="color: #004993;">text</span>=cur_drop.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				bodyDef.userData.<span style="color: #004993;">gotoAndStop</span><span style="color: #000000;">&#40;</span>cur_color<span style="color: #000000;">&#41;</span>;
				<span style="color: #009900;">// updating current weight and color with the next ones</span>
				cur_drop=next_drop;
				cur_color=next_color;
				<span style="color: #009900;">// changing current crate movieclip according to its weight and color</span>
				the_crate.weight.<span style="color: #004993;">text</span>=cur_drop.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				the_crate.<span style="color: #004993;">gotoAndStop</span><span style="color: #000000;">&#40;</span>cur_color<span style="color: #000000;">&#41;</span>;
				<span style="color: #009900;">// calculating next crate weight and color</span>
				next_drop=<span style="color: #004993;">Math</span>.<span style="color: #004993;">ceil</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#41;</span>;
				next_color=<span style="color: #004993;">Math</span>.<span style="color: #004993;">ceil</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #009900;">// updating next crate movieclip according to its weight and color</span>
				next_crate.weight.<span style="color: #004993;">text</span>=next_drop.<span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
				next_crate.<span style="color: #004993;">gotoAndStop</span><span style="color: #000000;">&#40;</span>next_color<span style="color: #000000;">&#41;</span>;
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Update<span style="color: #000000;">&#40;</span>e<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			m_world.Step<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">30</span>,<span style="color: #000000; font-weight:bold;">10</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> bb<span style="color: #000000; font-weight: bold;">:</span>b2Body = m_world.m_bodyList; bb; bb = bb.m_next<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>bb.m_userData <span style="color: #0033ff; font-weight: bold;">is</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
					bb.m_userData.<span style="color: #004993;">x</span>=bb.GetPosition<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">x</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">30</span>;
					bb.m_userData.<span style="color: #004993;">y</span>=bb.GetPosition<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">y</span><span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">30</span>;
					bb.m_userData.<span style="color: #004993;">rotation</span> = bb.GetAngle<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">180</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #004993;">Math</span>.<span style="color: #004993;">PI</span><span style="color: #000000;">&#41;</span>;
				<span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> debug_draw<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> dbgDraw<span style="color: #000000; font-weight: bold;">:</span>b2DebugDraw = <span style="color: #0033ff; font-weight: bold;">new</span> b2DebugDraw<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			<span style="color: #6699cc; font-weight: bold;">var</span> dbgSprite<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Sprite</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Sprite</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
			m_sprite.<span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>dbgSprite<span style="color: #000000;">&#41;</span>;
			dbgDraw.m_sprite=m_sprite;
			dbgDraw.m_drawScale=<span style="color: #000000; font-weight:bold;">30</span>;
			dbgDraw.m_alpha=<span style="color: #000000; font-weight:bold;">1</span>;
			dbgDraw.m_fillAlpha=<span style="color: #000000; font-weight:bold;">0.5</span>;
			dbgDraw.m_lineThickness=<span style="color: #000000; font-weight:bold;">1</span>;
			dbgDraw.m_drawFlags=b2DebugDraw.e_shapeBit;
			m_world.SetDebugDraw<span style="color: #000000;">&#40;</span>dbgDraw<span style="color: #000000;">&#41;</span>;
&nbsp;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And this is the result:</p>
<p><embed src="/downloads/stabilize3.swf" allowscriptaccess="always" menu="false" quality="high" width="500" height="400" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></p>
<p>The &#8220;next&#8221; crate is the one under the bar. <a href="/downloads/stabilize3.zip">Download the source code</a></p>
<p>Next time, we&#8217;ll see how to remove crates when three or more of them have the same color and collide</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/O64u7mZsk6g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/10/creation-of-a-flash-stabilize-clone-using-box2d-%e2%80%93-part-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/10/creation-of-a-flash-stabilize-clone-using-box2d-%e2%80%93-part-3/</feedburner:origLink></item>
		<item>
		<title>Triqui’s Picks #4</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/Tu_cCB9N-EQ/</link>
		<comments>http://www.emanueleferonato.com/2009/11/09/triquis-picks-4/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 10:35:37 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Links]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1936</guid>
		<description><![CDATA[This week I am featuring 7 games. I found other really interesting ones, but they were simply too wide&#8230; 800&#215;600 or even more.
Games with this size cannot be published on Facebook, and since I am porting triqui.com on Facebook, I won&#8217;t consider them, until Facebook raises the maximum width allowed for an application.
Here they are:
Running [...]]]></description>
			<content:encoded><![CDATA[<p>This week I am featuring 7 games. I found other really interesting ones, but they were simply too wide&#8230; 800&#215;600 or even more.</p>
<p>Games with this size cannot be published on Facebook, and since I am porting triqui.com on Facebook, I won&#8217;t consider them, until Facebook raises the maximum width allowed for an application.</p>
<p>Here they are:</p>
<p><a href="http://www.triqui.com/2009/11/06/running-free/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/running-free/_thumb_100x100.jpg" title="Running free" /></a><a href="http://www.triqui.com/2009/11/06/running-free/" target = "_blank"><strong>Running free</strong></a>: Interesting stick platform game with a &#8220;Fancy pants&#8221; feeling&#8230; you just have to run and jump.</p>
<p><strong>What I liked</strong>: the &#8220;just one more try&#8221; feeling</p>
<p><strong>Programming difficulty</strong>: There&#8217;s no physics, just some hit test I presume&#8230;. <strong>2/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/06/calculate-genius/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/calculate-genius/_thumb_100x100.jpg" title="Calculate Genius" /></a><a href="http://www.triqui.com/2009/11/06/calculate-genius/" target = "_blank"><strong>Calculate Genius</strong></a>: This is a &#8220;brain&#8221; game with a lot of minigames to test your ability to calculate.</p>
<p><strong>What I liked</strong>: considering myself a genius, I love these kind of games, just to prove I am smarter than you :)</p>
<p><strong>Programming difficulty</strong>: each minigame is quite easy, but there are a lot of them&#8230; and they are very well designed <strong>3/5</strong><span id="more-1936"></span></p>
<p><a href="http://www.triqui.com/2009/11/04/pixelvader/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/pixelvader/_thumb_100x100.jpg" title="Pixel Vader" /></a><a href="http://www.triqui.com/2009/11/04/pixelvader/" target = "_blank"><strong>Pixel Vader</strong></a>: Yessss, a good shoot&#8217;em up with powerups and achievements. Blasting away aliens is always fun.</p>
<p><strong>What I liked</strong>: the overall feeling</p>
<p><strong>Programming difficulty</strong>: collisions, powerups, alien waves&#8230; <strong>4/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/04/bubba-time/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/bubba-time/_thumb_100x100.jpg" title="Bubba Time" /></a><a href="http://www.triqui.com/2009/11/04/bubba-time/" target = "_blank"><strong>Bubba Time</strong></a>: It&#8217;s not a complete game at the moment, but just a demo. Great platform game with a lot of features, from creating your own platforms by building/removing blocks to rewinding the time to avoid enemies</p>
<p><strong>What I liked</strong>: Great concept</p>
<p><strong>Programming difficulty</strong>: a good platform is always difficult&#8230; <strong>5/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/02/green-bomber/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/green-bomber/_thumb_100x100.png" title="Green Bomber" /></a><a href="http://www.triqui.com/2009/11/02/green-bomber/" target = "_blank"><strong>Green Bomber</strong></a>: Remake of one of the oldest game ever (destroy buildings with your plane) with a phyisics twist and a campaign environment. A great one-button game.</p>
<p><strong>What I liked</strong>: I love original physics games</p>
<p><strong>Programming difficulty</strong>: Just some Box2d <strong>2/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/02/hans-coldy-and-emma-qualdy/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/hans-coldy-and-emma-qualdy/_thumb_100x100.png" title="Hans Coldy and Emma Qualdy" /></a><a href="http://www.triqui.com/2009/11/02/hans-coldy-and-emma-qualdy/" target = "_blank"><strong>Hans Coldy and Emma Qualdy</strong></a>: Interesting platform, you are something like a &#8220;spiked sponge&#8221; and must collect coins and avoid enemies saving its mate through 42 levels. You can climb or hang to some walls thanks to your spikes</p>
<p><strong>What I liked</strong>: The idea and the pixel graphics</p>
<p><strong>Programming difficulty</strong>: a good platform is always difficult. <strong>4/5</strong></p>
<p><a href="http://www.triqui.com/2009/11/02/unsucceful-test/" target = "_blank"><img class = "imgleft" alt="" src="http://thumbs.mochiads.com/c/g/unsucceful-test/_thumb_100x100.jpg" title="Unsucceful Test" /></a><a href="http://www.triqui.com/2009/11/02/unsucceful-test/" target = "_blank"><strong>Unsucceful Test</strong></a>: I think the author meant &#8220;unsuccessful&#8221;&#8230; you are a mad doctor trying to make an antidote for his unsuccessfule experiment. Great physics </p>
<p><strong>What I liked</strong>: The concept and the different shapes the doctor can have, each one with its features</p>
<p><strong>Programming difficulty</strong>: Quite hard. <strong>5/5</strong></p>
<p>See you next week</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/Tu_cCB9N-EQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/09/triquis-picks-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/09/triquis-picks-4/</feedburner:origLink></item>
		<item>
		<title>Moved on a new server</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/KSUe3vahgKk/</link>
		<comments>http://www.emanueleferonato.com/2009/11/08/moved-on-a-new-server/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 16:17:29 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Blogging]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1934</guid>
		<description><![CDATA[I am happy to annouce the blog has moved on a new server.
My old server, aruba.it, simply had too much problems to host a blog with high traffic, and as you probably experienced during the last days, the blog was hacked too much times.
The funny thing is every time I reported the problem to the [...]]]></description>
			<content:encoded><![CDATA[<p>I am happy to annouce the blog has moved on a new server.</p>
<p>My old server, <a href="http://www.aruba.it/" target = "_blank">aruba.it</a>, simply had too much problems to host a blog with high traffic, and as you probably experienced during the last days, the blog was hacked too much times.</p>
<p>The funny thing is every time I reported the problem to the customer care, they replied (normally after 24 hours, from monday to friday) it was my fault.</p>
<p>If I have a fault, is waiting that long before migrating (but I prefer to say &#8220;running away&#8221;)</p>
<p>Now I am hosted on <a target ="_blank" href="http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=triqui">HostGator</a> and finally I am back to life!!!</p>
<p>Since moving more than 6,000 files and about 25,000 queries can lead to some errors, I would like you to report any missing file or strange behavior to info[at]emanueleferonato.com</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/KSUe3vahgKk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/08/moved-on-a-new-server/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/08/moved-on-a-new-server/</feedburner:origLink></item>
		<item>
		<title>60 Seconds to Fame Contest</title>
		<link>http://feedproxy.google.com/~r/EmanueleFeronato/~3/9Dlpuo1E0cA/</link>
		<comments>http://www.emanueleferonato.com/2009/11/07/60-seconds-to-fame-contest/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 22:39:13 +0000</pubDate>
		<dc:creator>Emanuele Feronato</dc:creator>
				<category><![CDATA[Contests]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Game design]]></category>
		<category><![CDATA[Monetize]]></category>

		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=1929</guid>
		<description><![CDATA[Once upon a time there was Flash Game Friday
It was a Flash Game contest held by Mochimedia, and the staff awarded one game a week a $100 prize for being awesome. There were no other rules and no theme. It was simply the staff choosing something they really enjoyed.
Now things changed. The original Flash Game [...]]]></description>
			<content:encoded><![CDATA[<p>Once upon a time there was <strong>Flash Game Friday</strong></p>
<p>It was a Flash Game contest held by <a target = "_blank" href="https://www.mochimedia.com/r/972ae333a3c92a2a">Mochimedia</a>, and the staff awarded one game a week a $100 prize for being awesome. There were no other rules and no theme. It was simply the staff choosing something they really enjoyed.</p>
<p>Now things changed. The original Flash Game Friday has now become a monthly contest!</p>
<p>Developers will have one month to develop a game based on a specific theme, and the monthly prize is <strong>$500</strong>.</p>
<p><img src="http://www.emanueleferonato.com/wp-content/uploads/2009/11/3syt725z.jpg" /></p>
<p>Winners will be chosen from the eligible games by the <a target = "_blank" href="https://www.mochimedia.com/r/972ae333a3c92a2a">Mochi</a> staff.</p>
<p>The first monthly contest is <strong>60 Seconds to Fame</strong>.<span id="more-1929"></span></p>
<p><strong>Rules</strong>: Your game must be over/finished and ready for a score submission in 60 seconds or less. It does not matter how good you are in the game, it will still end in 60 seconds or less. The goal in these types of games is to push a user to get better, not so they can last longer, but rather get more points within that same time limit. It’s to spark the “oh, I get it,” or, “Maybe if I tried this…” in the player. Also, it’s to force a developer to stick to their idea without the fear of feature creep, which is often times a key factor in <a href="http://www.emanueleferonato.com/2008/03/17/wipe-the-vaporware-out-of-your-life/">causing your game to not be completed</a>.</p>
<p><strong>Deadline</strong>: December 4th, 2009 – 11:59PM PST</p>
<p><strong>Prizes</strong>: $400 for the winner, $50 each for two honorable mentions.</p>
<p>If you need some inspiration, on the <a href="http://mochiland.com/articles/november-2009-contest-60-seconds-to-fame" target = "_blank">official page</a> you can find six examples of games built around this theme. You will find all additional rules too.</p>
<img src="http://feeds.feedburner.com/~r/EmanueleFeronato/~4/9Dlpuo1E0cA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.emanueleferonato.com/2009/11/07/60-seconds-to-fame-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.emanueleferonato.com/2009/11/07/60-seconds-to-fame-contest/</feedburner:origLink></item>
	</channel>
</rss>
