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

<channel>
	<title>RevoluGame</title>
	<atom:link href="http://revolugame.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://revolugame.com</link>
	<description>Web and Game development</description>
	<lastBuildDate>Tue, 07 May 2013 13:35:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Ludum Dare #26 : Post mortem</title>
		<link>http://revolugame.com/ludum-dare-26-post-mortem/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ludum-dare-26-post-mortem</link>
		<comments>http://revolugame.com/ludum-dare-26-post-mortem/#comments</comments>
		<pubDate>Mon, 29 Apr 2013 19:20:53 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Post mortem]]></category>
		<category><![CDATA[Ludum Dare]]></category>
		<category><![CDATA[onegameamonth]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=1078</guid>
		<description><![CDATA[This weekend took place the 26th edition of the Ludum Dare event. So as I was busy for half the weekend, I decided to enter the contest, but with only 24 hours to make a game.
This time, with my coworkers from Atelier 801, we decided to work together, not on the same game, but at the same place,  [...]]]></description>
				<content:encoded><![CDATA[<p>This weekend took place the 26th edition of the <a href="http://ludumdare.com/compo" target="_blank">Ludum Dare</a> event. So as I was busy for half the weekend, I decided to enter the contest, but with only <strong>24 hours</strong> to make a game.</p>
<p>This time, with my coworkers from Atelier 801, we decided to work together, not on the same game, but at the same place, the company&#8217;s headquarters.<br />
It was really a good experience, and it helped me to focus on working.</p>
<p>As I mention in my &#8220;<a href="http://revolugame.com/ludum-dare-26-im-in/">I&#8217;m in</a>&#8221; post, I&#8217;ve used <a href="http://haxe.org" target="_blank">Haxe</a> to make a <strong>flash game</strong>.</p>
<p>You can find the game here : <a href="http://revolugame.com/games/ludum-dare-26-what-the-fish/">What the fish !!</a> and the <a href="http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&#038;uid=4401" target="_blank">vote form here</a>.</p>
<h3>How I prepared</h3>
<ul>
<li>For each theme in the final theme voting round, I&#8217;ve tried to come with a game concept. So before the beginning of the contest, I had lots of ideas.</li>
<li>I went to bed early the day before, so I was able to get up in the early morning.</li>
</ul>
<h3>What went right</h3>
<ul>
<li>I found a really simple (minimalist) game idea, where you have to kill fishing boats with potatoes (wait&#8230; what??). And of course, do not kill the pink salmons ;)</li>
<li>I made all the sprites really quickly, because I didn&#8217;t want to lose time on this.</li>
<li>I make flash games for a living, so the code is not really what&#8217;s bothering me the most.</li>
<li>Working with other people also participating to the Ludum Dare contest sets up a really nice working atmosphere.</li>
</ul>
<h3>What could have been better</h3>
<ul>
<li>The theme :D, because I had other (great?) ideas, but ideas that didn&#8217;t really fit with this theme</li>
<li>To have a little more time&#8230; </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/ludum-dare-26-post-mortem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ludum Dare #26 : I&#8217;m in</title>
		<link>http://revolugame.com/ludum-dare-26-im-in/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ludum-dare-26-im-in</link>
		<comments>http://revolugame.com/ludum-dare-26-im-in/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 11:17:07 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Ludum Dare]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=1061</guid>
		<description><![CDATA[I&#8217;m going to use this Ludum Dare for an excuse and make my first game of the year, despite all my efforts (&#8230; what a shame&#8230;).
This time I will be at Atelier801&#8216;s headquarters (in Lille, France), with my coworkers who will also participate !
I will use :

Haxe
As3fxr for the sound
Gimp for the  [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m going to use this <a href="http://www.ludumdare.com/compo/">Ludum Dare</a> for an excuse and make my first game of the year, despite all my efforts (&#8230; what a shame&#8230;).</p>
<p>This time I will be at <a href="https://twitter.com/Atelier801">Atelier801</a>&#8216;s headquarters (in Lille, France), with my coworkers who will also participate !</p>
<p>I will use :</p>
<ul>
<li><a href="http://haxe.org">Haxe</a></li>
<li><a href="http://www.superflashbros.net/as3sfxr/">As3fxr</a> for the sound</li>
<li><a href="http://www.gimp.org/">Gimp</a> for the graphics</li>
<li><a href="http://www.mapeditor.org/">Tiled</a> for the level design (if I need it)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/ludum-dare-26-im-in/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pull-to-refresh with Phonegap</title>
		<link>http://revolugame.com/pull-to-refresh-with-phonegap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pull-to-refresh-with-phonegap</link>
		<comments>http://revolugame.com/pull-to-refresh-with-phonegap/#comments</comments>
		<pubDate>Sat, 06 Apr 2013 14:44:05 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Phonegap]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=998</guid>
		<description><![CDATA[It&#8217;s been a while since my last post. I&#8217;ve been working on some projects that are quite time-consuming; that&#8217;s why I can&#8217;t (despite having 3 prototypes) work much longer on games for the one game a month challenge.
For one of my apps using Phonegap and JQuery Mobile, I needed a list with the &#8220;pull  [...]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been a while since my last post. I&#8217;ve been working on some projects that are quite <strong>time-consuming</strong>; that&#8217;s why I can&#8217;t (despite having 3 prototypes) work much longer on games for the <a href="http://www.onegameamonth.com/" target="_blank">one game a month challenge</a>.</p>
<p>For one of my apps using <strong>Phonegap</strong> and <strong>JQuery Mobile</strong>, I needed a list with the &#8220;<strong>pull to refresh</strong>&#8221; fonctionnality. After somes searchs and tests, I ended up using the <a href="https://github.com/watusi/jquery-mobile-iscrollview" target="_blank">Jquery Mobile iscrollview</a> widget, that works pretty well.</p>
<p>So here is a quick start for this feature.</p>
<h3>First of all, what is this widget for ?</h3>
<p>This widget is a <a href="http://jquerymobile.com" target="_blank">JQueryMobile</a> version of the <a href="https://github.com/cubiq/iscroll" target="_blank">iScroll</a> widget.</p>
<p>According to the autor website :</p>
<blockquote><p>The script development began because mobile webkit (on iPhone, iPad, Android) does not provide a native way to scroll content inside a fixed width/height element. </p></blockquote>
<p>By the way, this plugin allows you to use a lot of features like : </p>
<ul>
<li>Pinch / Zoom</li>
<li>Pull up/down to refresh</li>
<li>Improved speed and momentum</li>
<li>Snap to element</li>
<li>Customizable scrollbars</li>
</ul>
<h3>The code</h3>
<p>Assuming that you have a <a href="http://cordova.apache.org/" target="_blank">Phonegap</a> project already initialized, you need to add to your main html file :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/jquery.mobile.iscrollview.css&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;link</span> <span style="color: #000066;">rel</span>=<span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;css/jquery.mobile.iscrollview-pull.css&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/iscroll.js&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;script</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">&quot;js/jquery.mobile.iscrollview.js&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;text/javascript&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And a page like this :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">data-role</span>=<span style="color: #ff0000;">&quot;page&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;main&quot;</span> <span style="color: #000066;">data-position</span>=<span style="color: #ff0000;">&quot;fixed&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">data-role</span>=<span style="color: #ff0000;">&quot;header&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Test iScroll<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">data-iscroll</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000066;">data-role</span>=<span style="color: #ff0000;">&quot;content&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-wrapper&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-pulldown&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-pull-icon&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-pull-label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ul</span> <span style="color: #000066;">data-role</span>=<span style="color: #ff0000;">&quot;listview&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Item 1 culpa aut nam qui<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Item 2 minima quam temporibus quidem<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Item 3 commodi sint facilis numquam<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/li<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ul<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-pullup&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-pull-icon&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-pull-label&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The &#8220;<strong>list-view</strong>&#8221; inside the &#8220;<strong>data-iscroll</strong>&#8221; tag will now have the &#8220;<strong>pull to refresh</strong>&#8221; feature.<br />
If you need to do some actions (like refresh the content, &#8230;) you have to listen for some events :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> document <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">untyped</span> __js__<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">&quot;document&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
document.<span style="color: #006633;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">&quot;deviceready&quot;</span>, <span style="color: #6699cc; font-weight: bold;">function</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span> 
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">new</span> JQuery<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">function</span><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;">new</span> JQuery<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">&quot;.iscroll-wrapper&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #006633;">bind</span><span style="color: #000000;">&#40;</span>
        <span style="color: #000000;">&#123;</span>
            iscroll_onpulldown<span style="color: #339933;">:</span> onPullDown,
            iscroll_onpullup<span style="color: #339933;">:</span> onPullUp
        <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Here is the complete list of events for the pull-to-refresh feature :</p>
<ul>
<li>iscroll_onpulldown</li>
<li>iscroll_onpullup</li>
<li>iscroll_onpulldownreset</li>
<li>iscroll_onpulldownpulled</li>
<li>iscroll_onpulldownloading</li>
<li>iscroll_onpullupreset</li>
<li>iscroll_onpulluppulled</li>
<li>iscroll_onpulluploading</li>
</ul>
<p>The event callbacks takes two arguments :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;">onPullDown<span style="color: #000000;">&#40;</span>event<span style="color: #339933;">:</span> Event, data<span style="color: #339933;">:</span> <span style="color: #03F; ">Dynamic</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Void</span></pre></td></tr></table></div>

<p>The <strong>event</strong> argument is a basic JQuery Event.<br />
The <strong>data</strong> argument has only one member : <strong>iscrollview</strong>, that is the reference to the <strong>iscrollview</strong> object that made the callback.</p>
<p>And after that, if you want to hide the top or bottom part, just refresh the componant :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;">data.<span style="color: #006633;">iscrollview</span>.<span style="color: #006633;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Customization</h3>
<p>You can also custom the pull label text. All these options has default values, but you can custom them all :</p>
<ul>
<li><strong>pullDownResetText</strong> (default: &#8220;Pull down to refresh&#8230;&#8221;)</li>
<li><strong>pullDownPulledText</strong> (default: &#8220;Release to refresh&#8230;&#8221;)</li>
<li><strong>pullDownLoadingText</strong> (default: &#8220;Loading&#8230;&#8221;)</li>
<li><strong>pullUpResetText</strong> (default: &#8220;Pull up to refresh&#8230;&#8221;)</li>
<li><strong>pullUpPulledText</strong> (default: &#8220;Release to refresh&#8230;&#8221;)</li>
<li><strong>pullUpLoadingText</strong> (default: &#8220;Loading&#8230;&#8221;)</li>
</ul>
<p>If you want to change those values from the html, just set the correct attribute :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;iscroll-pull-label&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">data-iscroll-loading-text</span>=<span style="color: #ff0000;">&quot;Custom loading text&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">data-iscroll-pulled-text</span>=<span style="color: #ff0000;">&quot;Custom pulled text&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Custom reset text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>For more informations, here is <a href="https://github.com/watusi/jquery-mobile-iscrollview#pull-to-refresh" target="_blank">the place you want to go</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/pull-to-refresh-with-phonegap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One Game A Month Challenge</title>
		<link>http://revolugame.com/one-game-a-month-challenge/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=one-game-a-month-challenge</link>
		<comments>http://revolugame.com/one-game-a-month-challenge/#comments</comments>
		<pubDate>Tue, 01 Jan 2013 12:49:51 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[onegameamonth]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=769</guid>
		<description><![CDATA[What is the &#8216;one game a month&#8217; challenge ?
The goal is to publish at least one game by month for a year (so 12 games &#8230; if the calendar has not changed since the last time I checked).

Why ?
In my (short) indie developper&#8217;s life, finishing games is like the most difficult thing to do, mainly because  [...]]]></description>
				<content:encoded><![CDATA[<h2>What is the &#8216;one game a month&#8217; challenge ?</h2>
<p>The goal is to <strong>publish</strong> at least <strong>one game by month for a year</strong> (so 12 games &#8230; if the calendar has not changed since the last time I checked).</p>
<p><a href="http://onegameamonth.com" target="_blank"><img src="http://revolugame.com/wp-content/uploads/2012/12/ONE-GAME-A-MONTH-384px.png" alt="ONE-GAME-A-MONTH-384px" width="384" height="24" class="aligncenter size-full wp-image-772" /></a></p>
<h2>Why ?</h2>
<p>In my (short) indie developper&#8217;s life, finishing games is like <strong>the most difficult thing to do</strong>, mainly because of the lack of motivation. On my computer, I have a lot of prototypes &#8230; but not a real game (by real, I mean finished).<br />
So I hope this challenge will help <strong>motivating me</strong>, by <strong>showing my work to the whole community</strong>, and will allow me <strong>to improve my skills</strong>.</p>
<p>I&#8217;m not really a good 2D artist, but I&#8217;m really trying to upgrade this skill, so that I can make games without being limited by the design. I am aware that I&#8217;m not going to become a real artist, but if I can make basic pixel assets, it will be a fantastic move !</p>
<blockquote><p>Earn XP for doing what you love: making games!</p></blockquote>
<p>This challenge has an <strong>XP system</strong> based on the <a href="http://onegameamonth.com/achievements/" target="_blank">achievements</a> you won. All this system is juste for fun, there is no gain, just <strong>motivation</strong> and <strong>pride</strong> (at least if games are published ^^).</p>
<p>To show you all of my progress, I will post updates about my games on this page : <a href="http://revolugame.com/one-game-a-month/">http://revolugame.com/one-game-a-month/</a>. Don&#8217;t hesitate to comment the games !</p>
<p>My profile page : <a href="http://www.onegameamonth.com/RevoluGame" target="_blank">onegameamonth.com/RevoluGame</a>.</p>
<p>Let&#8217;s start with <a href="http://revolugame.com/one-game-a-month/january/">the first game</a> !!</p>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/one-game-a-month-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A quick start with nape and tilelayer</title>
		<link>http://revolugame.com/a-quick-start-with-nape-and-tilelayer/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-quick-start-with-nape-and-tilelayer</link>
		<comments>http://revolugame.com/a-quick-start-with-nape-and-tilelayer/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 22:28:47 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[nape]]></category>
		<category><![CDATA[NME]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=701</guid>
		<description><![CDATA[Recently, I started a mobile game with NME, and I wanted to give a try to nape. Since I&#8217;ve seen the NME&#8217;s runnermark, I&#8217;ve wanted to try the tilelayer library too. So why not dot it at the same time !
Overall view
Nape
This month was annonced the 2.0 version of nape. Nape is an open-source Haxe/AS3  [...]]]></description>
				<content:encoded><![CDATA[<p>Recently, I started a mobile game with <strong>NME</strong>, and I wanted to give a try to <a href="http://napephys.com" target="_blank">nape</a>. Since I&#8217;ve seen the <a href="https://github.com/elsassph/nme-runnermark" target="_blank">NME&#8217;s runnermark</a>, I&#8217;ve wanted to try the <a href="https://github.com/elsassph/nme-tilelayer" target="_blank">tilelayer</a> library too. So why not dot it at the same time !</p>
<h2>Overall view</h2>
<h3>Nape</h3>
<p>This month was annonced the <strong>2.0 version of nape</strong>. Nape is an <strong>open-source Haxe/AS3 physics engine</strong> that lets you do <strong>cross platform</strong> applications. It&#8217;s fast and powerful (actually I prefer <strong>nape</strong> over <strong>box2d</strong>, it&#8217;s much easier to use, and really fast). See by yourself : <a href="http://napephys.com/samples.html" target="_blank">http://napephys.com/samples.html</a>.</p>
<p>Just download it through <a href="http://lib.haxe.org/p/nape" target="_blank">haxelib</a> :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="code" style="font-family:monospace;">haxelib install nape</pre></td></tr></table></div>

<h3>Tilelayer</h3>
<p>To quote the github description :</p>
<blockquote><p>
A lightweight and very optimized wrapper over NME&#8217;s powerful but lowlevel &#8216;drawTiles&#8217; which offers the best rendering performance (ie. batching) on native platforms.
</p></blockquote>
<p>To install the <a href="http://lib.haxe.org/p/tilelayer" target="_blank">haxelib</a> version :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="code" style="font-family:monospace;">haxelib install tilelayer</pre></td></tr></table></div>

<p><span id="more-701"></span></p>
<h2>Simple implementation</h2>
<p>So now to use these two great libraries :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">import</span> <span style="color: #006699;">nape.phys.Body</span><span style="color: #339933;">;</span>
<span style="color: #6699cc; font-weight: bold;">import</span> <span style="color: #006699;">aze.display.TileSprite</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">class</span> Entity
<span style="color: #000000;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// The tilelayer's sprite</span>
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> sprite<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">default</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">:</span> TileSprite<span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// The nape's body</span>
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> body<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">default</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span> <span style="color: #339933;">:</span> Body<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> <span style="color: #6699cc; font-weight: bold;">new</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Update the positions and the rotation
     **/</span>
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> update<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;">if</span><span style="color: #000000;">&#40;</span>sprite <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> body <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            sprite.<span style="color: #006633;">x</span> <span style="color: #339933;">=</span> body.<span style="color: #006633;">position</span>.<span style="color: #006633;">x</span><span style="color: #339933;">;</span>
            sprite.<span style="color: #006633;">y</span> <span style="color: #339933;">=</span> body.<span style="color: #006633;">position</span>.<span style="color: #006633;">y</span><span style="color: #339933;">;</span>
            sprite.<span style="color: #006633;">rotation</span> <span style="color: #339933;">=</span> body.<span style="color: #006633;">rotation</span><span style="color: #339933;">;</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>All the entities will have to be updated on <strong>each frame</strong>, as well as the nape&#8217;s space and the layer :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> _space <span style="color: #339933;">:</span> Space<span style="color: #339933;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> _layer <span style="color: #339933;">:</span> TileLayer<span style="color: #339933;">;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> _entities <span style="color: #339933;">:</span> List<span style="color: #339933;">&lt;</span>Entity<span style="color: #339933;">&gt;;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> <span style="color: #6699cc; font-weight: bold;">new</span><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> tilesheet <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> SparrowTilesheet<span style="color: #000000;">&#40;</span>
        Assets.<span style="color: #006633;">getBitmapData</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">&quot;assets/spritesheet.png&quot;</span><span style="color: #000000;">&#41;</span>, 
        Assets.<span style="color: #006633;">getText</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">&quot;assets/spritesheet.xml&quot;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    _layer <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> TileLayer<span style="color: #000000;">&#40;</span>tilesheet<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    addChild<span style="color: #000000;">&#40;</span>_layer.<span style="color: #006633;">view</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    _space <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> Space<span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">new</span> Vec2<span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">600</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> update<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    _space.<span style="color: #006633;">step</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">60</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #6699cc; font-weight: bold;">for</span><span style="color: #000000;">&#40;</span>entity <span style="color: #6699cc; font-weight: bold;">in</span> _entities<span style="color: #000000;">&#41;</span>
        entity.<span style="color: #006633;">update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    _layer.<span style="color: #006633;">render</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Now to define a simple rectangular entity :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">class</span> Box <span style="color: #6699cc; font-weight: bold;">extends</span> Entity
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> <span style="color: #6699cc; font-weight: bold;">new</span><span style="color: #000000;">&#40;</span>pSpace<span style="color: #339933;">:</span> Space<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #6699cc; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// Nape's data</span>
        body <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> Body<span style="color: #000000;">&#40;</span>BodyType.<span style="color: #006633;">DYNAMIC</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
        body.<span style="color: #006633;">shapes</span>.<span style="color: #006633;">add</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">new</span> Polygon<span style="color: #000000;">&#40;</span>Polygon.<span style="color: #006633;">box</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">50</span>, <span style="color: #cc66cc;">50</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
        body.<span style="color: #006633;">position</span>.<span style="color: #006633;">setxy</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">10</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
        body.<span style="color: #006633;">space</span> <span style="color: #339933;">=</span> pSpace<span style="color: #339933;">;</span>
&nbsp;
        sprite <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> TileSprite<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">'box'</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And simply add it to the stage :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> box <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> Box<span style="color: #000000;">&#40;</span>_space<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
_entities.<span style="color: #006633;">add</span><span style="color: #000000;">&#40;</span>box<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
_layer.<span style="color: #006633;">addChild</span><span style="color: #000000;">&#40;</span> box.<span style="color: #006633;">sprite</span> <span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/a-quick-start-with-nape-and-tilelayer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AGE &#8211; How to support physic engines</title>
		<link>http://revolugame.com/age-how-to-support-physic-engines/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=age-how-to-support-physic-engines</link>
		<comments>http://revolugame.com/age-how-to-support-physic-engines/#comments</comments>
		<pubDate>Sat, 17 Nov 2012 16:54:06 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AGE]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[NME]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=616</guid>
		<description><![CDATA[In the previous post, we have seen how to use the Box2D support into the AGE engine. Now I just want to show you how simple it is to add a new framework/engine support.
For example, we are going to add the Nape support.
For those of you who don&#8217;t know, Nape is a Haxe/AS3 physics engine. Since Nape  [...]]]></description>
				<content:encoded><![CDATA[<p>In the previous post, we have seen how to use <a href="http://revolugame.com/age-box2d-support/" title="AGE – Box2D support">the Box2D support</a> into the <strong>AGE engine</strong>. Now I just want to show you how simple it is to add a new framework/engine support.</p>
<p>For example, we are going to add the <a href="https://github.com/deltaluca/nape/" target="_blank">Nape</a> support.</p>
<p>For those of you who don&#8217;t know, <strong>Nape</strong> is a <strong>Haxe/AS3</strong> physics engine. Since <strong>Nape</strong> is really close to <strong>Box2D</strong>, it will be simple to understand how <strong>box2d</strong> has been added to <strong>AGE</strong>.</p>
<h2>The behavior</h2>
<p>Since <strong>AGE</strong> is based on a <strong>behaviors system</strong>, we are just going to create a new behavior, that we will call <strong>NapeMovementBehavior</strong> :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">class</span> NapeMovementBehavior <span style="color: #6699cc; font-weight: bold;">implements</span> IBehavior
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _entity <span style="color: #339933;">:</span> BasicEntity<span style="color: #339933;">;</span>
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> enabled<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">default</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000033; font-weight: bold;">Bool</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> update<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Void</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> enable<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
	enabled <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> disable<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
	enabled <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Void</span> <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Now we are going to <strong>initialize</strong> the data needed by <strong>Nape</strong> for the behavior&#8217;s entity :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _body <span style="color: #339933;">:</span> Body<span style="color: #339933;">;</span>
<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">static</span> <span style="color: #6699cc; font-weight: bold;">var</span> world <span style="color: #339933;">:</span> Space<span style="color: #339933;">;</span>
<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> <span style="color: #6699cc; font-weight: bold;">new</span><span style="color: #000000;">&#40;</span>pEntity<span style="color: #339933;">:</span> BasicEntity, pDynamic<span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Bool</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>world <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
        world <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> Space<span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">new</span> Vec2<span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">500</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    _body <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> Body<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>pDynamic <span style="color: #339933;">?</span> BodyType.<span style="color: #006633;">DYNAMIC</span> <span style="color: #339933;">:</span> BodyType.<span style="color: #006633;">STATIC</span><span style="color: #000000;">&#41;</span>, 
                       <span style="color: #6699cc; font-weight: bold;">new</span> Vec2<span style="color: #000000;">&#40;</span>pEntity.<span style="color: #006633;">x</span> <span style="color: #339933;">+</span> pEntity.<span style="color: #006633;">halfWidth</span>, pEntity.<span style="color: #006633;">y</span> <span style="color: #339933;">+</span> pEntity.<span style="color: #006633;">halfHeight</span><span style="color: #000000;">&#41;</span>
                   <span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #6699cc; font-weight: bold;">var</span> block<span style="color: #339933;">:</span>Polygon <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> Polygon<span style="color: #000000;">&#40;</span>Polygon.<span style="color: #006633;">box</span><span style="color: #000000;">&#40;</span>pEntity.<span style="color: #006633;">width</span>,pEntity.<span style="color: #006633;">height</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    _body.<span style="color: #006633;">shapes</span>.<span style="color: #006633;">add</span><span style="color: #000000;">&#40;</span>block<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    _body.<span style="color: #006633;">align</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    _body.<span style="color: #006633;">space</span> <span style="color: #339933;">=</span> world<span style="color: #339933;">;</span>
&nbsp;
    _entity <span style="color: #339933;">=</span> pEntity<span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>If you need more information on how <strong>Nape</strong> is working, go check the <a href="http://deltaluca.me.uk/docnew/" target="_blank">documentation</a>.<br />
So for now, we have a basic entity initialized for working into Nape.<br />
<span id="more-616"></span><br />
We have to <strong>update</strong> the <strong>entity position</strong> into the game based on the Nape&#8217;s one :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> update<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Void</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #330000; font-weight: bold;">#if</span> cpp
    _entity.<span style="color: #006633;">x</span> <span style="color: #339933;">=</span> _body.<span style="color: #006633;">position</span>.<span style="color: #006633;">x</span><span style="color: #339933;">;</span>
    _entity.<span style="color: #006633;">y</span> <span style="color: #339933;">=</span> _body.<span style="color: #006633;">position</span>.<span style="color: #006633;">y</span><span style="color: #339933;">;</span>
    <span style="color: #330000; font-weight: bold;">#else</span>
    _entity.<span style="color: #006633;">x</span> <span style="color: #339933;">=</span> _body.<span style="color: #006633;">position</span>.<span style="color: #006633;">x</span> <span style="color: #339933;">-</span> _entity.<span style="color: #006633;">halfWidth</span><span style="color: #339933;">;</span>
    _entity.<span style="color: #006633;">y</span> <span style="color: #339933;">=</span> _body.<span style="color: #006633;">position</span>.<span style="color: #006633;">y</span> <span style="color: #339933;">-</span> _entity.<span style="color: #006633;">halfHeight</span><span style="color: #339933;">;</span>
    <span style="color: #330000; font-weight: bold;">#end</span>
&nbsp;
    _entity.<span style="color: #006633;">rotation</span> <span style="color: #339933;">=</span> _body.<span style="color: #006633;">rotation</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">57.2957795</span><span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>There is some differences between c++ and flash: with the flash renderer, we must have the center point at the top left position (for now).</p>
<p>Now the destroy function (called after the behavior has been removed) :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> destroy<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Void</span>
<span style="color: #000000;">&#123;</span>
    world.<span style="color: #006633;">bodies</span>.<span style="color: #006633;">remove</span><span style="color: #000000;">&#40;</span>_body<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>If you have noticed, the <strong>world</strong> variable is <strong>static</strong>, because we have to update it on each frame. So to keep the behaviors system intact, we are going to use the <strong>BehaviorsManager</strong> :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> <span style="color: #6699cc; font-weight: bold;">new</span><span style="color: #000000;">&#40;</span>pEntity<span style="color: #339933;">:</span> BasicEntity, pDynamic<span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Bool</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>world <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>    
	world <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> Space<span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">new</span> Vec2<span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">500</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>        
        BehaviorsManager.<span style="color: #006633;">getInstance</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #006633;">registerUpdater</span><span style="color: #000000;">&#40;</span>globalUpdate<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// [...]</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Now the <strong>globalUpdate()</strong> function is going to be called on each frame :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> globalUpdate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000033; font-weight: bold;">Void</span>
<span style="color: #000000;">&#123;</span>
    world.<span style="color: #006633;">step</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">30</span>, <span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">10</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<h2>How to use it ?</h2>
<p>Now to use this behavior with an entity, just add the <strong>NapeMovementBehavior</strong> to the behaviors list :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> e <span style="color: #339933;">:</span> BasicEntity <span style="color: #339933;">=</span> <span style="color: #6699cc; font-weight: bold;">new</span> BasicEntity<span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
e.<span style="color: #006633;">makeGraphic</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">32</span>, 0xFFFF0000<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// create a rectangle</span>
e.<span style="color: #006633;">addBehavior</span><span style="color: #000000;">&#40;</span> <span style="color: #6699cc; font-weight: bold;">new</span> NapeMovementBehavior<span style="color: #000000;">&#40;</span>e, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// add the behavior</span>
add<span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// add the entity to the game</span></pre></td></tr></table></div>

<p>Here is a quick demo (drag the blocks) :</p>

    <div id="swfobj_0">
      
    </div>

<p>You can see the <strong>NapeMovementBehavior</strong> class <a href="https://github.com/po8rewq/AGE/blob/master/src/com/revolugame/age/behaviors/NapeMovementBehavior.hx" title="NapeMovementBehavior.hx" target="_blank">here</a> and the <strong>NapeEntity</strong> class <a href="https://github.com/po8rewq/AGE/blob/master/src/com/revolugame/age/display/NapeEntity.hx" title="NapeEntity.hx" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/age-how-to-support-physic-engines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AGE &#8211; Box2D support</title>
		<link>http://revolugame.com/age-box2d-support/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=age-box2d-support</link>
		<comments>http://revolugame.com/age-box2d-support/#comments</comments>
		<pubDate>Sat, 10 Nov 2012 17:43:08 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AGE]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[NME]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=576</guid>
		<description><![CDATA[Since Box2D is one of the most used physics engine, I&#8217;ve started to implement it into the AGE game engine. 
I&#8217;ve used the box2d version from haxelib, so don&#8217;t forget to add the following to your nmml file :

&#60;haxelib name=&#34;box2d&#34; /&#62;

I&#8217;ve implemented it with the behaviors system. So now we have a  [...]]]></description>
				<content:encoded><![CDATA[<p>Since <a href="http://box2d.org/" target="_blank">Box2D</a> is one of the most used <strong>physics engine</strong>, I&#8217;ve started to implement it into the AGE game engine. </p>
<p>I&#8217;ve used the box2d version from <a href="http://lib.haxe.org/p/box2d" target="_blank">haxelib</a>, so don&#8217;t forget to add the following to your nmml file :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;haxelib</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;box2d&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

<p>I&#8217;ve implemented it with the <strong>behaviors system</strong>. So now we have a <strong>Box2dEntity</strong> that has a special Behavior (Box2dMovementBehavior) which initialize and update all the Box2D stuff.</p>
<p>For example, to define an entity :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">import</span> <span style="color: #006699;">com.revolugame.age.display.Box2dEntity</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">class</span> Block <span style="color: #6699cc; font-weight: bold;">extends</span> Box2dEntity
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">function</span> <span style="color: #6699cc; font-weight: bold;">new</span> <span style="color: #000000;">&#40;</span>pX<span style="color: #339933;">:</span> <span style="color: #000033; font-weight: bold;">Int</span>, pY<span style="color: #339933;">:</span> <span style="color: #000033; font-weight: bold;">Int</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #6699cc; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span>pX, pY<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
        makeGraphic<span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">32</span>, 0xFF000000<span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
        initBox2dStuff<span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">30</span>, <span style="color: #000066; font-weight: bold;">true</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//                                     ^ friction</span>
<span style="color: #666666; font-style: italic;">//                                  ^ restitution</span>
<span style="color: #666666; font-style: italic;">//                               ^ density</span>
<span style="color: #666666; font-style: italic;">//                          ^ if the entity is dynamic</span>
<span style="color: #666666; font-style: italic;">//                     ^ conversion meters to pixels</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;">add<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">new</span> Block<span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">10</span>, <span style="color: #cc66cc;">50</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And that&#8217;s it !</p>
<p>The <strong>Box2D</strong> support works with <strong>Flash</strong> and <strong>C++</strong> but needs some optimization for now.<br />
<span id="more-576"></span><br />
Here is a quick example (click on the blocks to remove them) :</p>

    <div id="swfobj_1">
      
    </div>

<p>You can also apply a <strong>force</strong> or an <strong>impulse</strong> on your entity :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;">_b2dBehavior.<span style="color: #006633;">applyImpulse</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">2</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// x, y</span>
_b2dBehavior.<span style="color: #006633;">applyForce</span><span style="color: #000000;">&#40;</span><span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">2</span><span style="color: #000000;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// x, y</span></pre></td></tr></table></div>

<p>Another example (click on the oranges to apply a random impulse) :</p>

    <div id="swfobj_2">
      
    </div>

<p>For more information on <strong>Box2D</strong>, check out <a href="http://www.box2dflash.org/docs/2.0.2/manual" target="_blank">the flash documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/age-box2d-support/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Case study: mobile app with Haxe</title>
		<link>http://revolugame.com/case-study-mobile-app-with-haxe/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=case-study-mobile-app-with-haxe</link>
		<comments>http://revolugame.com/case-study-mobile-app-with-haxe/#comments</comments>
		<pubDate>Sat, 28 Jul 2012 14:58:28 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Haxe]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=492</guid>
		<description><![CDATA[Problematic
I needed to look for the best technologies to use for a cross platform mobile application.
I need to develop a simple application, linked with all Android/Iphone/Windows tools like the calendar, contacts, etc&#8230; and of course, the application must have a simple and integrated UI (as close  [...]]]></description>
				<content:encoded><![CDATA[<h2>Problematic</h2>
<p>I needed to look for the <strong>best technologies</strong> to use for a <strong>cross platform mobile application</strong>.<br />
I need to develop a <strong>simple application</strong>, linked with all Android/Iphone/Windows tools like the calendar, contacts, etc&#8230; and of course, the application must have a simple and integrated UI (as close as possible to the OS).</p>
<p>My first thought was to give <a href="http://haxenme.org" target="_blank">NME</a> a try for a non game application.</p>
<h2>NME</h2>
<p>NME is <strong>my favorite tool for a game</strong> or a big application (RIA) that needs good performances (when you compile, it produces C++ code and not Java or objective-C).</p>
<p>NME is <strong>not 100% integrated</strong> with all the OS. You can do it, but you have to <strong>code specific parts for each OS</strong>, and you <strong>have to know C++</strong> and that&#8217;s not my case right now.</p>
<p>And finally, there is no simple UI framework that can be used with a cross platform mobile app (and for a commercial project, I&#8217;m not comfortable with using a young library like <a href="http://haxe.org/com/libs/cocktail/" target="_blank">Cocktail</a> or <a href="http://www.aswing.org/" target="_blank">HaxeAsWing</a>).</p>
<p>I&#8217;ve heard about <a href="http://phonegap.com/" title="PhoneGap" target="_blank">PhoneGap</a>, a simple tool that lets you code <strong>JavaScript</strong> and deploy it to all the most used mobile OS platforms. So why not give it a try?</p>
<h2>What is PhoneGap ?</h2>
<blockquote><p>Developing with PhoneGap gives you the freedom to create mobile applications for iOS, Android, Blackberry, Windows Phone, Palm WebOS, Bada and Symbian using the web code you know and love: HTML, CSS and Javascript.</p></blockquote>
<h2>How is PhoneGap working?</h2>
<p>To deploy to a specific platform, you are going to need the SDK, and what&#8217;s best to compile and deploy (for Windows it&#8217;s <a href="http://www.microsoft.com/visualstudio/en-us" target="_blank">Visual Studio</a>, for the others you can just use the terminal with the SDK tools).</p>
<p>For each platform (I promise, that is the last time I&#8217;m saying that) you have to create a default project (look at the <a href="http://docs.phonegap.com/en/2.0.0/guide_getting-started_index.md.html" target="_blank">Getting Started Guide</a>).</p>
<p>Now that you have the structure, we can start the <strong>JavaScript</strong> part. </p>
<p class="info">Every JS (and html/css) files must be in the <em>www</em> directory.</p>
<p>Since I&#8217;m using <strong>Haxe</strong>, I need to <strong>generate all the externals</strong> for using code completion.<br />
Here is an example of what you have to do :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;">@<span style="color: #339933;">:</span>native<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">&quot;window.device&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #6699cc; font-weight: bold;">extern</span> <span style="color: #6699cc; font-weight: bold;">class</span> Device 
<span style="color: #000000;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//public static var name	(default, null) : String;</span>
	<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">static</span> <span style="color: #6699cc; font-weight: bold;">var</span> cordova	<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">default</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>	<span style="color: #339933;">:</span> <span style="color: #000033; font-weight: bold;">String</span><span style="color: #339933;">;</span>
	<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">static</span> <span style="color: #6699cc; font-weight: bold;">var</span> platform	<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">default</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>	<span style="color: #339933;">:</span> <span style="color: #000033; font-weight: bold;">String</span><span style="color: #339933;">;</span>
	<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">static</span> <span style="color: #6699cc; font-weight: bold;">var</span> uuid		<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">default</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>	<span style="color: #339933;">:</span> <span style="color: #000033; font-weight: bold;">String</span><span style="color: #339933;">;</span>
	<span style="color: #6699cc; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">static</span> <span style="color: #6699cc; font-weight: bold;">var</span> version	<span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">default</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span>	<span style="color: #339933;">:</span> <span style="color: #000033; font-weight: bold;">String</span><span style="color: #339933;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Now in your JS project, if you want to display your uuid :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="haxe" style="font-family:monospace;">js.<span style="color: #006633;">Lib</span>.<span style="color: #006633;">document</span>.<span style="color: #006633;">getElementById</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">&quot;uuid&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #006633;">innerHTML</span> <span style="color: #339933;">=</span> Device.<span style="color: #006633;">uuid</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And the HTML part :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>UUID: <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;span</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;uuid&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> <span style="color: #ddbb00;">&amp;nbsp;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/h4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p><strong>PhoneGap</strong> allows you access to all the device functionalities. Look at the <a href="http://docs.phonegap.com/en/2.0.0/index.html" target="_blank">documentation</a> for more details.</p>
<p>So now we have a basic project working, we have to search for an UI framework. And since we can use any JS framework &#8230; we have <strong>plenty of choices</strong>.<br />
<span id="more-492"></span></p>
<h2>JavaScript UI framework</h2>
<p>I personally have selected <a href="http://www.sencha.com/products/touch/" target="_blank">SenchaTouch</a> for its community and its maturity. </p>
<p>Like PhoneGap, you have to generate externals. But since it&#8217;s a bigger library, <strong>we must automate that</strong>. So I&#8217;ve searched on the web to see if someone had already done that, and I found on <a href="https://github.com/jgranick/senchatouch" target="_blank">Github</a> externals that has been generated by <a href="http://www.joshuagranick.com/blog/" target="_blank">Joshua Granick</a>. </p>
<p>But there are some errors that prevent the compilation. After some research (and thanks to the <a href="https://groups.google.com/forum/?fromgroups#!forum/haxelang" target="_blank">Google Haxe Group</a>) I found how to fix all the errors. There are two problems :</p>
<ul>
<li><strong>args:</strong> must be changed to <strong>?args: Array< Dynamic ></strong></li>
<li>The Array and the String class must be removed</li>
</ul>
<p>Just to be sure I have the last <strong>SenchaTouch</strong> version, I&#8217;ve generated them by using (thanks again to Joshua) <a href="http://lib.haxe.org/p/buildhx" target="_blank">BuildHX</a>. Since this tool is <strong>only working on Windows</strong>, I&#8217;ve updated the sources to use the Linux version of <a href="https://github.com/senchalabs/jsduck" target="_blank">JSDuck</a>.</p>
<p>Here is the <a href="http://revolugame.com/wp-content/uploads/SenchaTouchExternals.zip">package</a> with all the externals classes for <strong>the last version of the SenchaTouch Framework</strong> (2.0.1.1).</p>
<p>You can now test the <a href="http://docs.sencha.com/touch/2-0/#!/guide/first_app" target="_blank">Getting Started Project</a>. You can download here the Haxe <a href="http://www.haxejs.org/index.php/download_file/view/10/">portage</a> (hosted on <a href="http://www.haxejs.org/" target="_blank">haxejs</a>).<br />
There are some minor changes that need to be made for it to be working (It&#8217;s just some parameters that are missing).</p>
<h2>Conclusion</h2>
<p>From my point of view, <strong>PhoneGap</strong> is what&#8217;s better for me, mostly because of its HTML5 support.<br />
For the rest, I prefer the <strong>SenchaTouch</strong> approach and of course <strong>Haxe JS</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/case-study-mobile-app-with-haxe/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>AGE &#8211; QuadTree implementation</title>
		<link>http://revolugame.com/age-quadtree-implementation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=age-quadtree-implementation</link>
		<comments>http://revolugame.com/age-quadtree-implementation/#comments</comments>
		<pubDate>Sun, 08 Jul 2012 19:29:26 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[AGE]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[NME]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=404</guid>
		<description><![CDATA[What is the QuadTree ?
If we look at the wikipedia page, we can find a small explanation (it&#8217;s the best one I have found so far) :
A quadtree is a tree data structure in which each internal node has exactly four children. Quadtrees are most often used to partition a two dimensional space by  [...]]]></description>
				<content:encoded><![CDATA[<h2>What is the QuadTree ?</h2>
<p>If we look at the <a href="http://en.wikipedia.org/wiki/Quadtree">wikipedia</a> page, we can find a small explanation (it&#8217;s the best one I have found so far) :</p>
<blockquote><p>A quadtree is a tree data structure in which each internal node has exactly four children. Quadtrees are most often used to partition a two dimensional space by recursively subdividing it into four quadrants or regions.</p></blockquote>
<h2>Why would I add it ?</h2>
<p>The first approach to <strong>detect collisions</strong> between entities was to check <strong>for each entity</strong> if it collided with one of the others entities in the world. So you can use this method for a really small game, because the number of tests is not that big. But if you have, for example, a game with 100 entities moving around the screen, which can collide with each other, the number of tests between entities will be 100&#215;100 !! And at least half (probably more) of them are <strong>not necessary</strong>.<br />
The Quadtree allows you to eliminate those unnecessary checks.</p>
<h2>How does it work ?</h2>
<p>Each time an entity is added to the stage, we just have to look into the tree and find where to put it. A node is simply a rectangular zone with entities and other nodes in it.</p>
<p>So basically, any node will be <strong>divided in 4 nodes</strong> if <strong>more than n entities</strong> are <strong>completely contained</strong> within the node. For AGE, I have decided to use n = 2.</p>
<p>Here is a more concrete example :</p>
<p><a href="http://revolugame.com/wp-content/uploads/2012/07/tree0.png"><img src="http://revolugame.com/wp-content/uploads/2012/07/tree0.png" alt="" title="tree0" width="153" height="153" class="aligncenter size-full wp-image-452" /></a></p>
<div style="text-align:center">The world has 1 entity, the entity is added to the root node (depth = 0).</div>
<p>&nbsp;</p>
<p><a href="http://revolugame.com/wp-content/uploads/2012/07/tree1.png"><img src="http://revolugame.com/wp-content/uploads/2012/07/tree1.png" alt="" title="tree1" width="153" height="153" class="aligncenter size-full wp-image-451" /></a></p>
<div style="text-align:center">A second entity is added, so the world has been divided. The first entity (<span style="color:#FF0000">the red one</span>) is pushed down to the top left node, and the <span style="color:#a0e045">second one</span> is pushed down to the top right node (depth = 1).</div>
<p>&nbsp;</p>
<p><a href="http://revolugame.com/wp-content/uploads/2012/07/tree2.png"><img src="http://revolugame.com/wp-content/uploads/2012/07/tree2.png" alt="" title="tree2" width="153" height="153" class="aligncenter size-full wp-image-456" /></a></p>
<div>A third entity is added to the stage. This one is contained in the top left node. This node <strong>has already another entity</strong>, so we just divide this node in 4. Now the first entity (<span style="color:#FF0000">the red one</span>) does not fit entirely in a sub node, so this entity is going to stay on the same node (<strong>top left at depth 1</strong>). But the other entity (<span style="color:#364fd2">the blue one</span>) is pushed down to the <strong>bottom right node at depth 2</strong>. For the <span style="color:#a0e045">last entity</span>, nothing has to change for now.</div>
<p>&nbsp;</p>
<p>Now, our tree <strong>has been set</strong>. Before checking for collisions, we have <strong>to query the tree</strong> to determine which entities are <strong>worth testing for a rectangular zone</strong> (the rectangular zone can correspond to the theoretical position of an entity, to know if we can move it or not). So, the quadtree is going to <strong>return each entity contained in a node that have an intersection with our request zone</strong> (we have to return entities that are not entirely in a sub node too).<br />
<span id="more-404"></span><br />
Here is a simple example: use the arrow keys to move the black entity, and look at the nodes (especially when near the entity at the right of the world) : </p>
<div class="embedswf">
    <div id="swfobj_3">
      
    </div>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/age-quadtree-implementation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>AGE project setup</title>
		<link>http://revolugame.com/age-project-setup/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=age-project-setup</link>
		<comments>http://revolugame.com/age-project-setup/#comments</comments>
		<pubDate>Sun, 01 Jul 2012 13:31:03 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[AGE]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[NME]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=382</guid>
		<description><![CDATA[Since the 0.2 version, you can quickly and easily install AGE in haxelib, just by using the ant task :

git clone https://github.com/po8rewq/AGE.git
ant

For now, you can run the following command to setup a new project :

haxelib run AGE

This will generate a basic structure for your project, with  [...]]]></description>
				<content:encoded><![CDATA[<p>Since the 0.2 version, you can quickly and easily install <strong>AGE</strong> in haxelib, just by using the ant task :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git clone</span> https:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>po8rewq<span style="color: #000000; font-weight: bold;">/</span>AGE.git
ant</pre></td></tr></table></div>

<p>For now, you can run the following command to setup a new project :</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">haxelib run AGE</pre></td></tr></table></div>

<p>This will generate a <strong>basic structure</strong> for your project, with the <strong>nmml</strong> file, and the <a href="http://monodevelop.com/">MonoDevelop</a> &#8211; <a href="http://www.flashdevelop.org/">FlashDevelop</a> project files.</p>
<p>Here is the list of all arguments you can use :</p>
<ul>
<li><strong>-help</strong> : the help screen</li>
<li><strong>-output</strong> : /your/project/directory (default: the current directory)</li>
<li><strong>-name</strong> : Your Project Name</li>
<li><strong>-main</strong> : MainProjectClass (default: Main)</li>
<li><strong>-size</strong> : WIDTH HEIGHT (default: 800&#215;600)</li>
<li><strong>-fps</strong> : FPS (default: 30)</li>
<li><strong>-bgColor</strong> : COLOR (default: 0xCECECE, you can use both 0xFF0000 and #FF0000 syntax)</li>
</ul>
<p class="alert">This tool has only been tested on Linux &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/age-project-setup/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
