<?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>Sun, 02 Jun 2013 17:06:55 +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>[FR] L&#8217;Open Data : un service pour tous</title>
		<link>http://revolugame.com/open-data-un-service-pour-tous/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=open-data-un-service-pour-tous</link>
		<comments>http://revolugame.com/open-data-un-service-pour-tous/#comments</comments>
		<pubDate>Sun, 02 Jun 2013 17:06:55 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[open data]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=1354</guid>
		<description><![CDATA[<p>
Malgré les efforts de l&#8217;État (etalab, data.gouv.fr), nous pouvons observer une grande disparité entre les initiatives des différentes communes françaises concernant l&#8217;open data.
De grandes villes ouvrent des portails accessibles par tous et mis à jour très régulièrement (pour ne pas tous les  [...]</p><p>The post <a href="http://revolugame.com/open-data-un-service-pour-tous/">[FR] L&#8217;Open Data : un service pour tous</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></description>
				<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-1381" alt="opendata1" src="http://revolugame.com/wp-content/uploads/2013/06/opendata1-300x56.png" width="300" height="56" /></p>
<p>Malgré les efforts de l&#8217;État (<a href="http://etalab.gouv.fr">etalab</a>, <a href="http://www.data.gouv.fr/">data.gouv.fr</a>), nous pouvons observer une grande disparité entre les initiatives des différentes communes françaises concernant l&#8217;<a href="http://fr.wikipedia.org/wiki/Donn%C3%A9es_ouvertes" target="_blank">open data</a>.</p>
<p>De grandes villes ouvrent des portails accessibles par tous et mis à jour très régulièrement (pour ne pas tous les citer, on peut trouver <a href="http://data.nantes.fr" target="_blank">Nantes</a>, <a href="http://opendata.montpelliernumerique.fr" target="_blank">Montpellier</a>, <a href="http://data.grandtoulouse.fr" target="_blank">Toulouse</a> et même <a href="http://opendata.paris.fr" target="_blank">Paris</a>) alors que d&#8217;autres sont relativement en retard (non non, je ne parlerai pas de Lille&#8230;).</p>
<p>De mon point de vue, le <strong>partage de données</strong> publiques peut être d&#8217;une très grande utilité pour la collectivité. Des particuliers, voire même des entreprises, développent, depuis une initiative personnelle ou par le biais de concours (<a href="http://bemyapp.com/devkings2013/" target="_blank">Dev&#8217;Kings</a>, <a href="http://www.etalab.gouv.fr/pages/Presentation-6371441.html" target="_blank">Dataconnexions</a>&#8230;), des applications qui peuvent <strong>rendre la vie</strong> de tous les jours beaucoup <strong>plus simple</strong>.</p>
<p>Par exemple via des applications indiquant les emplacements de parking, les vélos en libre service, les transports en commun, etc. (la <a href="http://data.sncf.com" target="_blank">SNCF</a>, la <a href="http://data.ratp.fr/" target="_blank">RATP</a>, ou <a href="https://developer.jcdecaux.com/" target="_blank">JC Decaux</a> ayant ouvert leurs données récemment). Voire des applications touristiques, mais encore et surtout des statistiques.</p>
<p>Par exemple, voici une petite démo de ce qui peut être fait rapidement et qui pourrait être très utile dans certains cas, même si bien sûr je ne vous souhaite pas que ce genre de service vous soit un jour utile ;). J&#8217;ai décidé de prendre les informations concernant <a href="http://opendata.montpelliernumerique.fr/Defibrillateurs" target="_blank">les défibrillateurs de la ville de Montpellier</a> et de les afficher sur une carte, en y ajoutant la géolocalisation de l&#8217;utilisateur. Service tout bête qui ne m&#8217;a pas pris plus d&#8217;<strong>une heure</strong> (en comptant le nettoyage des données) pour afficher les positions des défibrillateurs sur une carte (via <a href="http://leafletjs.com" target="_blank">Leaflet</a>).</p>
<p>Et pourquoi ne pas en faire une application mobile, et en y ajoutant un <strong>guide</strong> sur l&#8217;utilisation d&#8217;un défibrillateur, et un bouton pour <strong>appeler rapidement les secours</strong> ?<br />
Voilà ce qu&#8217;il serait possible de faire, simplement en partant d&#8217;une liste de coordonnées GPS mis à disposition par la ville de Montpellier.</p>
<p>Pour prendre un exemple concret, récemment j&#8217;ai développé une application permettant aux utilisateurs du réseau <a href="http://vlille.fr" target="_blank">V&#8217;Lille</a> de vérifier la disponibilité de vélos proches de leur position (<a href="http://revolugame.com/lille-aux-velos/">Lille Aux Vélos</a>).<br />
Il m&#8217;a été difficile de me procurer les informations dont j&#8217;avais besoin. A aucun moment <a href="http://transpole.fr" target="_blank">Transpole</a> ne fait mention de son API ni même de ses données alors que tout est accessible sans restrictions&#8230; </p>
<p>Pourquoi développer cette application me direz-vous ? Pour la simple et bonne raison que Transpole a jugé utile de développer une application sur <a href="https://itunes.apple.com/fr/app/vlille/id500047408?mt=8" target="_blank">iPhone</a>, mais de simplement faire une application qui contient le site mobile (lent et pas vraiment utilisable) sur <a href="https://play.google.com/store/apps/details?id=com.transpole.vlille" target="_blank">Android</a>&#8230; Et puis, comme on dit : &#8220;on n&#8217;est jamais mieux servi que par soi-même&#8221; ;).</p>
<p>Alors on peut se demander pourquoi de grandes villes ou grands groupes ne font pas un petit effort qui irait certainement dans leur sens, en permettant à d&#8217;autres personnes de développer des services annexes aux leurs et donc de faciliter la vie de tous les jours à tant de gens &#8230;<br />
<span id="more-1354"></span></p>
<p><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script></p>
<div id="map_canvas" style="width: 690px; height: 400px; border: 3px solid #757575;">F5 if nothing shows</div>
<ul>
<li><a id="locateOnMap" href="#map_canvas">Trouver ma position (si inaccessible le centre de Montpellier est utilisé comme référence)</a></li>
<li><a id="closerOnMap" href="#map_canvas">Trouver le défibrillateur le plus proche</a></li>
</ul>
<p><script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js"></script><br />
<script type="text/javascript" src="/wp-includes/lab/defibrillators_mtp/defibApp.js"></script></p>
<p>The post <a href="http://revolugame.com/open-data-un-service-pour-tous/">[FR] L&#8217;Open Data : un service pour tous</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/open-data-un-service-pour-tous/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Planets experiment</title>
		<link>http://revolugame.com/planets-experiment/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=planets-experiment</link>
		<comments>http://revolugame.com/planets-experiment/#comments</comments>
		<pubDate>Thu, 30 May 2013 20:17:25 +0000</pubDate>
		<dc:creator>Adrien</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[1GAM]]></category>
		<category><![CDATA[AGE]]></category>
		<category><![CDATA[Haxe]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://revolugame.com/?p=1164</guid>
		<description><![CDATA[<p>So now, it&#8217;s officially the 1PAM (one prototype a month).
It&#8217;s a simple conquest game, my first targeting HTML5. So it was more an excuse to update my game engine, so that it can compile to js.
AGE is still an Haxe framework, but now NME is not required anymore.
The engine will be compatible Flash  [...]</p><p>The post <a href="http://revolugame.com/planets-experiment/">Planets experiment</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></description>
				<content:encoded><![CDATA[<p>So now, it&#8217;s officially the <strong>1PAM</strong> (one prototype a month).</p>
<p>It&#8217;s a simple conquest game, my first targeting <strong>HTML5</strong>. So it was more an excuse to update my game engine, so that it can compile to <strong>js</strong>.</p>
<p><a href="https://github.com/po8rewq/AGE" target="_blank">AGE</a> is still an <a href="http://haxe.org" target="_blank">Haxe</a> framework, but now <a href="http://nme.io" target="_blank">NME</a> is not required anymore.<br />
The engine will be compatible Flash (again) soon.</p>
<p><a href="/games/one-game-a-month/1gam-may-2013/">Here is the link</a>, if you want to test it.</p>
<p><a href="http://revolugame.com/wp-content/uploads/2013/05/screenshotsaturday.png"><img class="aligncenter size-medium wp-image-1165" alt="screenshotsaturday" src="http://revolugame.com/wp-content/uploads/2013/05/screenshotsaturday-300x225.png" width="300" height="225" /></a></p>
<p>The post <a href="http://revolugame.com/planets-experiment/">Planets experiment</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/planets-experiment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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[<p>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,  [...]</p><p>The post <a href="http://revolugame.com/ludum-dare-26-post-mortem/">Ludum Dare #26 : Post mortem</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>
<p>The post <a href="http://revolugame.com/ludum-dare-26-post-mortem/">Ludum Dare #26 : Post mortem</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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[<p>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  [...]</p><p>The post <a href="http://revolugame.com/ludum-dare-26-im-in/">Ludum Dare #26 : I&#8217;m in</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>
<p>The post <a href="http://revolugame.com/ludum-dare-26-im-in/">Ludum Dare #26 : I&#8217;m in</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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[<p>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  [...]</p><p>The post <a href="http://revolugame.com/pull-to-refresh-with-phonegap/">Pull-to-refresh with Phonegap</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>
<p>The post <a href="http://revolugame.com/pull-to-refresh-with-phonegap/">Pull-to-refresh with Phonegap</a> appeared first on <a href="http://revolugame.com">RevoluGame</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[<p>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  [...]</p><p>The post <a href="http://revolugame.com/one-game-a-month-challenge/">One Game A Month Challenge</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>
<p>The post <a href="http://revolugame.com/one-game-a-month-challenge/">One Game A Month Challenge</a> appeared first on <a href="http://revolugame.com">RevoluGame</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[<p>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  [...]</p><p>The post <a href="http://revolugame.com/a-quick-start-with-nape-and-tilelayer/">A quick start with nape and tilelayer</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>

<p>The post <a href="http://revolugame.com/a-quick-start-with-nape-and-tilelayer/">A quick start with nape and tilelayer</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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[<p>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  [...]</p><p>The post <a href="http://revolugame.com/age-how-to-support-physic-engines/">AGE &#8211; How to support physic engines</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>
<p>The post <a href="http://revolugame.com/age-how-to-support-physic-engines/">AGE &#8211; How to support physic engines</a> appeared first on <a href="http://revolugame.com">RevoluGame</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[<p>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  [...]</p><p>The post <a href="http://revolugame.com/age-box2d-support/">AGE &#8211; Box2D support</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>
<p>The post <a href="http://revolugame.com/age-box2d-support/">AGE &#8211; Box2D support</a> appeared first on <a href="http://revolugame.com">RevoluGame</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[<p>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  [...]</p><p>The post <a href="http://revolugame.com/case-study-mobile-app-with-haxe/">Case study: mobile app with Haxe</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></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>
<p>The post <a href="http://revolugame.com/case-study-mobile-app-with-haxe/">Case study: mobile app with Haxe</a> appeared first on <a href="http://revolugame.com">RevoluGame</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://revolugame.com/case-study-mobile-app-with-haxe/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
