<?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>Touch My Pixel Blog</title>
	<atom:link href="http://blog.touchmypixel.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.touchmypixel.com</link>
	<description>Games + Web</description>
	<lastBuildDate>Tue, 02 Mar 2010 00:28:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Away3DLite haXe + Morphing</title>
		<link>http://blog.touchmypixel.com/2010/02/away3dlite-haxe-morphing/</link>
		<comments>http://blog.touchmypixel.com/2010/02/away3dlite-haxe-morphing/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 08:21:15 +0000</pubDate>
		<dc:creator>tarwin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=241</guid>
		<description><![CDATA[I recently started on a 3D Flash job and was chuffed to find that Cauê Waneck has been porting Away3DLite to haXe. Anyway, suffice to say I was super-happy that I didn't have to do any AS3.
What's there currently is a direct port of the Away3dLite library, but in haXe. It makes a big use [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started on a 3D Flash job and was chuffed to find that Cauê Waneck has been porting Away3DLite to haXe. Anyway, suffice to say I was super-happy that I didn't have to do any AS3.</p>
<p>What's <a href="http://code.google.com/p/away3d/source/browse/#svn/trunk/haxe/Away3DLite/debug/away3dlite">there currently</a> is a direct port of the Away3dLite library, but in haXe. It makes a big use of the AS3 (FP10) native Vector (Vectora&lt;Float&gt;) so it's quite fast, but not directly portable to platforms other than Flash 10 yet. As far as I can tell performance is the same as, or similar to the FP10 AS3 release, but Cauê has assured me that he's having fun optimizing it.</p>
<p>Away3DLite is missing some functionality that is in the full version, things that I need for my current project, including the Morpher and AnimatedBitmapMovieMaterial classes. The first I've ported myself and the second has been ported by Cauê (thanks mate!).</p>
<p>So, here's a demonstration of Morphing working: <a rel="shadowbox;width=800;height=600;background:flashParams{bgcolor:'#21445A'}" href="/tmploader.swf?src=http://blog.touchmypixel.com/wp-content/uploads/2010/02/away3dlite_haxe_morph1.swf">Morph Test</a> and here's another: <a rel="shadowbox;width=800;height=600;background:flashParams{bgcolor:'#21445A'}" href="/tmploader.swf?src=http://blog.touchmypixel.com/wp-content/uploads/2010/02/morph_mouth1.swf">Mouth Morph Test</a>.</p>
<p>And the <a href="http://blog.touchmypixel.com/wp-content/uploads/2010/02/Morpher.txt">Morpher.hx</a> class.</p>
<p>I had a lot of trouble getting it working to start with but it's pretty easy once you get the ideas down. The main problem I had was the fact that neither the Collada object, nor the Object3D you get from it when doing .parseGeometry() has any vertices, so I got nothing when I passed it to the Morpher. What I'd missed is that I need to get one of the children from the Object3D that I get from the Collada .parseGeometry(). This is because, as <a href="http://www.everydayflash.com/blog/index.php/2008/08/26/using-the-bend-modifier-with-collada-objects/">Bartek Drozdz points out</a>, "<em>a Collada file represents a scene, not a single 3d object</em>".</p>
<p>The next thing to know is that you should wait for the ParserEvent.PARSE_SUCCESS events dispatched from your Collada objects. When these are done you can use .getChildAt(0) on your .parseGeometry(colladaData) object to get a Mesh which you can then parse to your Morpher. In my example I have:</p>
<div class="igBar"><span id="lactionscript-3"><a href="#" onclick="javascript:showPlainTxt('actionscript-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-3">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">m0 = cast c0.<span style="color: #006600;">parseGeometry</span><span style="color: #66cc66;">&#40;</span>daeData1<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// used to restet Morpher to original state</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">m1 = cast c1.<span style="color: #006600;">parseGeometry</span><span style="color: #66cc66;">&#40;</span>daeData1<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// the model that I scene.addChild(m1) to</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">m2 = cast c2.<span style="color: #006600;">parseGeometry</span><span style="color: #66cc66;">&#40;</span>daeData2<span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// the model to Morph to </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>As you should notice I'm using the same daeData for both <em>m0</em> and <em>m1</em>. I make my new Morpher passing it<em> m1</em>, then on each enterFrame:</p>
<div class="igBar"><span id="lactionscript-4"><a href="#" onclick="javascript:showPlainTxt('actionscript-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-4">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mp.<span style="color: #0066CC;">start</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mp.<span style="color: #006600;">mix</span><span style="color: #66cc66;">&#40;</span>cast m2.<span style="color: #006600;">getChildAt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span> + <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">sin</span><span style="color: #66cc66;">&#40;</span>Lib.<span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;color:#800000;">150</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mp.<span style="color: #006600;">mix</span><span style="color: #66cc66;">&#40;</span>cast m2.<span style="color: #006600;">getChildAt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">1</span> + <span style="color: #0066CC;">Math</span>.<span style="color: #0066CC;">cos</span><span style="color: #66cc66;">&#40;</span>Lib.<span style="color: #0066CC;">getTimer</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;color:#800000;">250</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> / <span style="color: #cc66cc;color:#800000;">3</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">mp.<span style="color: #006600;">finish</span><span style="color: #66cc66;">&#40;</span>cast m0.<span style="color: #006600;">getChildAt</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Hope that helps someone else, I was stuck for days <img src='http://blog.touchmypixel.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Tarwin<br />
Yay my first post in months!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2010/02/away3dlite-haxe-morphing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting smooth verticle scrolling with flash</title>
		<link>http://blog.touchmypixel.com/2010/02/getting-smooth-verticle-scrolling-with-flash/</link>
		<comments>http://blog.touchmypixel.com/2010/02/getting-smooth-verticle-scrolling-with-flash/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 02:11:05 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=226</guid>
		<description><![CDATA[We are working on a top down racing game, where the background scrolls vertically. This soulds like something flash should be able to do - no sweat! I've run into two issues:
1 - massive screen tearing - as the whole screen is scrolling vertically
2 - fluctuations in the processing time of frames, causes non-smooth motion [...]]]></description>
			<content:encoded><![CDATA[<p>We are working on a top down racing game, where the background scrolls vertically. This soulds like something flash should be able to do - no sweat! I've run into two issues:</p>
<p>1 - massive screen tearing - as the whole screen is scrolling vertically</p>
<p>2 - fluctuations in the processing time of frames, causes non-smooth motion (i think)</p>
<p>Here is a simple test of black balls falling down the screen. You should see tearing on the circles, rending issues (the bottom of the circle is cropped off sometimes) and jumpy verticle motion. I've tested on various computers+systems &amp; it seems the issues running from worst to best are as follows:</p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_window.html">VIEW TEST</a> - maximise the window for most shocking results</p>
<p>WORST<br />
mac osx<br />
windows 7<br />
windows xp x64<br />
windows vista<br />
windows xp<br />
BEST</p>
<p>To me it doesnt make much difference between firefox, ie, chrome. Most tests were run on QuadCore 2.5ghz comps. Except windows XP, which is P4 3.0, and macbook 2.4. - funnily the slowest comp (p4) ran the best.</p>
<p>It is quite common knowlege that flash doesnt perform any doublebuffering or v-sync, to fix screen tearing. UnitZeroOne has a great <a href="http://www.unitzeroone.com/blog/2009/11/30/help-me-test-flash-vsync-and-screen-tearing/" target="_blank">article on this</a>. Luckily flashPlayer 10 has a new WMODE - DIRECT, which seems to fix the issue a fair bit. <a href="http://www.adobe.com/newsletters/edge/august2008/articles/article2/index.html?trackingid=DLFXH"> According to adobe</a> it: "The direct WMODE will use your video card to paint pixels to the screen as fast as possible while freeing up your CPU to work on other tasks"</p>
<p>This seems to have a few issues with rendering (for us thus far) But it is a LOT smoother. It seems that it shouldnt have too much of a speed decrease (like transparent/opaque) either, after<a href="http://blog.michaeljbowen.com/?p=11"> looking at some tests</a></p>
<p>Circle test in:</p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_window.html">Window</a></p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_transparent.html">Transparent</a></p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_opaque.html">Opaque</a></p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_direct.html">Direct</a></p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_gpu.html">GPU</a></p>
<p><strong>The final issue:</strong></p>
<p>AS you can see, the motion is still not totally smooth in DIRECT mode. It seems that flash has issues with updating the frames at a constant interval, which is noticable when i want a constant scroll. I dont know if there will ever be any way to get around this.</p>
<p>any ideas?</p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/circle_scroll.zip">download test source</a></p>
<p>Cheers! Tony</p>
<p><strong>UPDATE:</strong></p>
<p>I've made a new version which moves the balls based on time, rather than frames. It basically moves 300pixels/second. ~ the same speed as before. It doesnt seem to make too much differnce - sometimes you get large jumps as the time lapses, and then the balls need to catch up - so not a great fix, but interesting.</p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_window_dt.html">Window - Time based</a></p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/Test_direct_dt.html">Direct - Time based</a></p>
<p><a href="http://www.touchmypixel.com/blog_examples/100203_circle_scroll/circle_scroll2.zip">download v2 test source </a>(only haxe version is time based)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2010/02/getting-smooth-verticle-scrolling-with-flash/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>.net magazine (UK) Caching Animation in Flash/AS3</title>
		<link>http://blog.touchmypixel.com/2009/12/net-magazine-caching-animation-in-flashas3/</link>
		<comments>http://blog.touchmypixel.com/2009/12/net-magazine-caching-animation-in-flashas3/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 07:45:11 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=221</guid>
		<description><![CDATA[For the upcomming article that Tarwin wrote for .NET magazine on Caching Animations in Flash here is a quick rundown &#38; downloadable example.
The code is split into two classes:
AnimationCache
This is a very simple singleton class used to cache the rendered frames of any animation (MovieClip) that you want. All you need to do is call [...]]]></description>
			<content:encoded><![CDATA[<p>For the upcomming article that Tarwin wrote for <a href="http://www.netmag.co.uk/">.NET magazine</a> on Caching Animations in Flash here is a quick rundown &amp; downloadable example.</p>
<p>The code is split into two classes:</p>
<p><strong>AnimationCache</strong></p>
<p>This is a very simple singleton class used to cache the rendered frames of any animation (MovieClip) that you want. All you need to do is call .cacheAnimation(identifier)  with the library identifier of your movieClip to store its frames in memory.</p>
<p><strong>Animation<br />
</strong></p>
<p>An animation displays the cached frames. You can retrieve instances from the AnimationCache via the getAnimation method. This will save memory, as each instance of the animation (if you have many jellyfish for example) will be referencing the same bitmap data. You can also create a new Animation(identifier), to create and cache a new animation from the library.</p>
<p>The animation class has similar functionality to MovieClip - play(), stop(), gotoAndPlay, etc.</p>
<p>To define the region that is cached (the first frame might be small, while frame 10 might be HUGE for example), you can define a 'bounds' clip. This is a child clip on the first frame of the MovieClip to be cached. It can also be used to crop an animation.</p>
<p>There are a few extra little features that we have in there that were used in scarygirl, you can find them out yourself ;P</p>
<p>Note: we have removed the queued caching system that we used in scarygirl, to simplify the code. If you are caching a lot of animations, you will need to look at ways to asyncronously cache frames. hint: think timeouts ;P</p>
<p><a href="http://www.touchmypixel.com/blog_examples/CachingAnimations.zip">DOWNLOAD EXAMPLE HERE</a></p>
<p>cheers Tony</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/12/net-magazine-caching-animation-in-flashas3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Box2D ContactPoint Filtering</title>
		<link>http://blog.touchmypixel.com/2009/12/box2d-contactpoint-filtering/</link>
		<comments>http://blog.touchmypixel.com/2009/12/box2d-contactpoint-filtering/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 13:08:46 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=210</guid>
		<description><![CDATA[I've just had the pleasure of spending 3 days rebuilding and battling with a box2d game i'm adding some features to, to realize that the main issue was that i didnt understand corretly how the box2d ContactListeners work.
When you create a custom Contact Listner, you extend b2ContactListener. this then recieved events Add, Persist, and Remove. [...]]]></description>
			<content:encoded><![CDATA[<p>I've just had the pleasure of spending 3 days rebuilding and battling with a box2d game i'm adding some features to, to realize that the main issue was that i didnt understand corretly how the box2d ContactListeners work.</p>
<p>When you create a custom Contact Listner, you extend b2ContactListener. this then recieved events Add, Persist, and Remove. these functions are called and a b2ContactPoint is sent as an argument. You are advised to store contact information and act on it AFTER the simulation step is completed. I foolishly thought that i could simply store the b2ContactPoint objects. WRONG!</p>
<p><strong>you cannot store the b2ContactPoint sent to the b2Contactlistener functions. </strong>I've modified <a href="http://www.box2d.org/wiki/index.php?title=Listening_to_contact_events_in_Box2D_AS3">this page</a> on the box2d site to stress this point. You must copy the contact information and store it in your own custom object as box2d reuses its b2ContactPoint object (storing it in a static var i believe). Not knowing this has cost me a lot of pain as my collisions were alwas *half* working, so i hope you can avoid it.</p>
<p><strong>Contact Manager Class</strong></p>
<p>To act on the collision events i wanted to store them in a useful way than simply in an array. It is useful to group them by their Bodies. I can get a list of collisions like:</p>
<div class="igBar"><span id="lactionscript-9"><a href="#" onclick="javascript:showPlainTxt('actionscript-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-9">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">contactManager.<span style="color: #006600;">getContactPoints</span><span style="color: #66cc66;">&#40;</span>ContactManager.<span style="color: #006600;">TYPE_ADD</span>, myBody1, myBody2<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// returns an Array of ContactPoint objects </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lactionscript-10"><a href="#" onclick="javascript:showPlainTxt('actionscript-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-10">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">contactManager.<span style="color: #006600;">getContacts</span><span style="color: #66cc66;">&#40;</span>ContactManager.<span style="color: #006600;">TYPE_ADD</span>, myRigidBody<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// returns a Dictionary with colliding bodies as the keys and Arrays holding </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// the custom ContactPoint objects as values. Very useful to get all bodies</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// colliding with a single object, such as your player. </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>If you set userData on the b2Bodies it can use useful to check this to see the type of the body (type of enemy for example) and call differnt code on your player to react to collisions. </p>
<div class="igBar"><span id="lactionscript-11"><a href="#" onclick="javascript:showPlainTxt('actionscript-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-11">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package com.<span style="color: #006600;">touchmypixel</span>.<span style="color: #006600;">box2D</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">b2ContactPoint</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2Body</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2ContactListener</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">utils</span>.<span style="color: #006600;">Dictionary</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ContactManager <span style="color: #0066CC;">extends</span> b2ContactListener</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const TYPE_ADD:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"ADD"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const TYPE_PERSIST:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"PERSIST"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #0066CC;">static</span> const TYPE_REMOVE:<span style="color: #0066CC;">String</span> = <span style="color: #ff0000;">"REMOVE"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> contactAdd:Dictionary = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> contactPersist:Dictionary = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> contactRemove:Dictionary = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ContactManager<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">Add</span><span style="color: #66cc66;">&#40;</span>point:b2ContactPoint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; registerContact<span style="color: #66cc66;">&#40;</span>contactAdd, point<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Persist<span style="color: #66cc66;">&#40;</span>point:b2ContactPoint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; registerContact<span style="color: #66cc66;">&#40;</span>contactPersist, point<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; override <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Remove<span style="color: #66cc66;">&#40;</span>point:b2ContactPoint<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; registerContact<span style="color: #66cc66;">&#40;</span>contactRemove,point<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> registerContact<span style="color: #66cc66;">&#40;</span>dic:Dictionary, point:b2ContactPoint<span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> b1:b2Body = point.<span style="color: #006600;">shape1</span>.<span style="color: #006600;">GetBody</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> b2:b2Body = point.<span style="color: #006600;">shape2</span>.<span style="color: #006600;">GetBody</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>dic<span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> dic<span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>dic<span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> dic<span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span> = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>dic<span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> dic<span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>dic<span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span> == <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span> dic<span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span> = <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> cp:ContactPoint = <span style="color: #000000; font-weight: bold;">new</span> ContactPoint<span style="color: #66cc66;">&#40;</span>b1, b2, point.<span style="color: #006600;">shape1</span>, point.<span style="color: #006600;">shape2</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dic<span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>cp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dic<span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#91;</span>b1<span style="color: #66cc66;">&#93;</span>.<span style="color: #0066CC;">push</span><span style="color: #66cc66;">&#40;</span>cp<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getContacts<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">type</span>:<span style="color: #0066CC;">String</span>, body1:b2Body<span style="color: #66cc66;">&#41;</span> <img src='http://blog.touchmypixel.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ictionary</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> dic;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">switch</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">type</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> TYPE_ADD: dic = contactAdd; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> TYPE_PERSIST: dic = contactPersist; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> TYPE_REMOVE: dic = contactRemove; <span style="color: #b1b100;">break</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> dic<span style="color: #66cc66;">&#91;</span>body1<span style="color: #66cc66;">&#93;</span> != <span style="color: #000000; font-weight: bold;">null</span> ? dic<span style="color: #66cc66;">&#91;</span>body1<span style="color: #66cc66;">&#93;</span> : <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getContactPoints<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">type</span>:<span style="color: #0066CC;">String</span>, b1:b2Body, b2:b2Body<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">Array</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> contacts = getContacts<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">type</span>, b1<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> contacts<span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span> != <span style="color: #000000; font-weight: bold;">null</span> ? contacts<span style="color: #66cc66;">&#91;</span>b2<span style="color: #66cc66;">&#93;</span> : <span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #0066CC;">clear</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; contactAdd = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; contactPersist = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; contactRemove = <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You will need to make a custom ContactPoint class. I've only stored shape and body information, but you can store position, etc. - remember to use .Copy() on b2Vec's as to copy the value however.</p>
<div class="igBar"><span id="lactionscript-12"><a href="#" onclick="javascript:showPlainTxt('actionscript-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-12">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package com.<span style="color: #006600;">touchmypixel</span>.<span style="color: #006600;">box2D</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Collision</span>.<span style="color: #006600;">Shapes</span>.<span style="color: #006600;">b2Shape</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> Box2D.<span style="color: #006600;">Dynamics</span>.<span style="color: #006600;">b2Body</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ContactPoint</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> body1:b2Body;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> body2:b2Body;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> shape1:b2Shape;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> shape2:b2Shape;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ContactPoint<span style="color: #66cc66;">&#40;</span>body1:b2Body, body2:b2Body, shape1:b2Shape, s2:b2Shape<span style="color: #66cc66;">&#41;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">body1</span> = body1;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">body2</span> = body2;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">shape1</span> = shape1;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">this</span>.<span style="color: #006600;">shape2</span> = shape2;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>It would be good to put the ContactPoint objects in a pool - to save instantiation.</p>
<p>cheers!<br />
tonypee</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/12/box2d-contactpoint-filtering/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>haXe MouseWheel on Mac OS X</title>
		<link>http://blog.touchmypixel.com/2009/11/haxe-mousewheel-on-mac-os-x/</link>
		<comments>http://blog.touchmypixel.com/2009/11/haxe-mousewheel-on-mac-os-x/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 03:11:46 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=202</guid>
		<description><![CDATA[So, mouse scroll wheel events still dont work [edit] In browser [/edit] on osx! its hard to believe, but true. Luckily i found a great SWFObject plugin + as3 class from PixelBreaker in his blogpost :
AS3.0 MouseWheel on Mac OS X
It didnt take too long to port the code across to haxe in order to [...]]]></description>
			<content:encoded><![CDATA[<p>So, mouse scroll wheel events still dont work [edit] In browser [/edit] on osx! its hard to believe, but true. Luckily i found a great SWFObject plugin + as3 class from <a href="http://blog.pixelbreaker.com" target="_blank">PixelBreaker</a> in his blogpost :</p>
<p id="post-63"><a href="http://blog.pixelbreaker.com/flash/as30-mousewheel-on-mac-os-x/" target="_blank">AS3.0 MouseWheel on Mac OS X</a></p>
<p>It didnt take too long to port the code across to haxe in order to add the finishing touch to our latest haxe/flash website <a href="http://www.cityonahill.com.au/">City on a Hill</a>.<br />
NOTE: You should run the test through a server (eg. apache) to avoid annoying security issues.</p>
<p>Download the <a href="http://www.touchmypixel.com/blog_examples/swfmacmousewheel_hx.zip">Source and Demo here</a></p>
<p>cheers,</p>
<p>Tony</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/11/haxe-mousewheel-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multiplayer Games in Flash</title>
		<link>http://blog.touchmypixel.com/2009/11/multiplayer-games-in-flash/</link>
		<comments>http://blog.touchmypixel.com/2009/11/multiplayer-games-in-flash/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 04:53:01 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=185</guid>
		<description><![CDATA[
I've been having a little play with creating multiplayer games in flash. Its kinda like that basic game - Gorilla, or was that Bannanas? hmm... not as chunky gfx yet tho ;P
It sounds pretty easy at first - but is getting a little complicated - even with my small test. The haxe mailinglist has been [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-187" title="gorillaz" src="http://blog.touchmypixel.com/wp-content/uploads/2009/11/gorillaz.png" alt="gorillaz" width="690" height="280" /></p>
<p>I've been having a little play with creating multiplayer games in flash. Its kinda like that basic game - Gorilla, or was that Bannanas? hmm... not as chunky gfx yet tho ;P</p>
<p>It sounds pretty easy at first - but is getting a little complicated - even with my small test. The haxe mailinglist has been helpful in getting me started with some good advice.</p>
<p>One approach is to use an authoritative server - where the server runs a simulation of the game. Clients then connect &amp; post their user input to the server. The server will make changes to the simulation and then post back updates to the client(s) about what has changed/is relevant to the user. This is a solid way to ensure that each client is getting the same experience. A major downside to this approach is the greater server load associated with running a game simulation. Especially if the game is planned to run a physics simulation (eg box2d), then the processing would be far too great - especially if a game only supports 2 players, and therefore the number of simulations/players will be extreme.  A great upside of using haxe is that the game logic required to run the simulation on the clientside, can easily be compiled to the serverside target (neko, c++) to run the server. This will prove a MASSIVE bonus for creating authoritative multiplayer flash games.</p>
<p>The approach i've taken is to only run updates on the client side. There are 3 different systems running in the test:</p>
<p><strong>Rotating a cannon</strong></p>
<p>The keypress event is sent to the server with the new roataion, this new roataion is broadcast to all clients (including yourself) then the rotation is applied. This means that you should experience similar latency to the opposition. Which isnt great - but it is very simple. As it is linked to the 'cannon' update loop - events are fired to the server at the tick rate (60fps) which isnt great either - a 'rate' should be capped for updates.</p>
<p><strong>Creating CannonBalls</strong></p>
<p>The event to create a CannonBall is send to the server. This is so that the server can increment a 'count' of cannonballs. It is important the each client can identify each cannonball - for later destruction. This is the only authoritative part of the simulation. Each cannonball is also 'owned' by a certain player - meaning that that players simulation controls its motion. This is fine for the simple test, but i can see that if cannonballs 'owned' by one player needed to interact with balls owned by the other, then problems could arise.</p>
<p><strong>Updating CannonBalls</strong></p>
<p>So, each client updates the motion of 'its' balls, and boardcasts this to the other clients (via the server). This means that you have smooth motion of your own objects.</p>
<p>In a turn based game (what i'm looking at making) this switching of 'ownership' of the simulated objects should work reasonably well - the non dominant client will have a more latent, jittery simulation (as inaccuracies are fixed). Another option would be to run one of the clients as the 'dominant' or 'server' client all of the time. This would be similar to how quake runs when you run it on a local network (atleast how use used to run quakeworld - hah memories).</p>
<p>So now i'm loking at ways to reduce/account for latency - as i think that over the internet the test would run a little jumpy.</p>
<p><strong>Running the test</strong></p>
<p>compile the hxml file (install haxe/neko from www.haxe.org)</p>
<p>run the server.bat</p>
<p>open 2 instances of the bin/Gorillaz.swf</p>
<p><a href="http://www.touchmypixel.com/blog_examples/091106_gorillaz/gorillaz_multiplayer.zip">Download the game test</a></p>
<p>cheers Tony</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/11/multiplayer-games-in-flash/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Scarygirl &#8211; awards</title>
		<link>http://blog.touchmypixel.com/2009/10/scarygirl-awards/</link>
		<comments>http://blog.touchmypixel.com/2009/10/scarygirl-awards/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 05:17:30 +0000</pubDate>
		<dc:creator>tarwin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=164</guid>
		<description><![CDATA[Since Scarygirl's release we've had a lot of feedback, both good and bad, from the Internet at large. Happily it seems to make more people smile than it does rip their hair out and has been nominated for multiple awards, even winning a few of them! Here's a quick run-down. [Just a quick note, the [...]]]></description>
			<content:encoded><![CDATA[<p>Since <a href="http://www.scarygirl.com/">Scarygirl</a>'s release we've had a lot of feedback, both good and bad, from the Internet at large. Happily it seems to make more people smile than it does rip their hair out and has been nominated for multiple awards, even winning a few of them! Here's a quick run-down. [Just a quick note, the Scaryigrl game not just our work - so kudos to everyone else who worked on it including Nathan and <a href="http://www.renmotion.com/">Suren</a>!]</p>
<h2>Nominations and awards</h2>
<p>Scarygirl was nominated in four separate categories in the <a href="http://www.tsumea.com/australasia/australia/news/081209/the-gdaa-game-developer-awards-2009-results">GDAA Game Developer Awards 2009</a> including Best downloadable title, Best Audio, Best Graphics and Best Game.</p>
<p>The first one, and probably the biggest in terms of being nominated, is the <strong><a href="http://www.afi.org.au/AM/ContentManagerNet/HTMLDisplay.aspx?ContentID=7960&amp;Section=Screen_Content_Innovation_Award">AFI award</a></strong> for "Screen Content Innovation". This was a new award this year and war announced earlier than the main awards for general film. The other people nominated included two produced by ABC TV and another by the Channel 9 Network, so we were in good company. Alas in the end we were beaten by the Gallipoli interactive; I guess you just can't fight war. Congratulations to them though as they created quite an amazing peace [sic].</p>
<p>Scarygirl also got nominated for "best of online games" by a UK/Ireland TV station called <a href="http://en.wikipedia.org/wiki/E4_(channel)"><strong>E4</strong></a><strong> </strong>(<a href="http://www.e4.com/game/scarygirl/review.e4">Scarygirl review</a>). We didn't win that one either but people seemed to enjoy it at least and we were up against such amazing games as <a href="http://www.mirrorsedge2d.com/">Mirror's Edge 2D</a> and <a href="http://www.newgrounds.com/portal/view/480006">Closure</a>.</p>
<p>The UK seems to love Scarygirl. Channel 5's Gadget Show put it in the <a href="http://fwd.five.tv/gadget-show/videos/top-5/top-5-browser-games">top 5 browser games</a>!</p>
<p>Scarygirl's first award was an <a href="http://www.thefwa.com/"><strong>FWA (Flash Website Award)</strong></a><strong> </strong>on the 7th August. This might not seem like such an amazing thing to the general public but to Tony and myself this was one of the most exciting as we'd been looking at the site for years wondering when something we did got up there.</p>
<p>We also won the "<strong>Desktop Create: Digital Media</strong>" award. Yay! [Ed: Pics coming soon]</p>
<p>The <a href="http://www.howdesign.com/competitions/">2009 HOW Interactive Competition</a> just gave the Scarygirl game a <em>merit</em> award, thanks guys, and<span style="text-decoration: line-through;"> it's currently sitting as a finalist</span> it got a bronze award in the <a href="http://www.liaentries.com/winners/?id_medium=2&amp;id_category=0&amp;view=details&amp;range=w&amp;page=48&amp;keyword=&amp;medium=&amp;category=&amp;award=&amp;country=&amp;title_brand=&amp;credits=&amp;company_name=&amp;city=&amp;proceed_simple_search=false&amp;proceed_advanced_search=false">2009 London International Awards</a> in the games category!</p>
<p>It's currently sitting as a finalist in the Games category of the 2010 <a href="http://sxsw.com/interactive/webawards/finalists">SXSW Web Awards</a> - here's hoping!</p>
<p>Scarygirl just won the <a href="http://www.commarts.com/interactive/cai10/scarygirl.html">Communication Arts Interactive Annual 16: Entertainment</a> award.</p>
<h2>Honourable mentions</h2>
<p>Adobe featured Scarygirl on their <a href="http://www.adobe.com/devnet/games/">Adobe Developer Connection</a> as an inspiration Flash game. We got featured along-side our friend's game <a href="http://bunnibunni.com/">Bunni </a>- so congradulations!</p>
<p>.net Magazine, a UK based web and design magazine, featured the Scarygirl game along with an interview with Nathan, Sophie and ourselves. In it they call Scarygirl "the best Flash game ever" - thanks! We also wrote a tutorial for the magazine explaining how to use <a href="http://blog.touchmypixel.com/2009/12/net-magazine-caching-animation-in-flashas3/">bitmap caching to speed up animations</a>. The same month Scarygirl was also featured in the Australian Desktop magazine.</p>
<p>As well as awards, and "we nearly got it" awards, there's been a whole lot of media coverage. Being in print is great to show your grandma, "Hey, Gran, see we do real stuff" so we were very happy to have a review in <a href="http://www.theage.com.au/digital-life/games/scarygirls-more-than-just-a-pretty-face-20090615-c8xm.html">The Age Greenguide</a> as well as in the <a href="http://www.smh.com.au/news/digital-life/games/articles/more-than-just-a-pretty-face/2009/05/12/1241893983881.html">Sydney Morning Herald</a>. There was even an <a href="http://blogs.theage.com.au/screenplay/archives//012078.html">interview on one of The Age's blogs</a>. There was also a lot of different</p>
<p>Online's been a little bit of a different story. With great responses to previews we got onto places such as <a href="http://www.tigsource.com/articles/2009/04/14/scarygirl">TIGSource </a>and <a href="http://www.indiegames.com/blog/2009/04/browser_game_pick_scarygirl_to.html">IndieGames </a>(thanks guys) we were super happy when we released it and managed to get it onto <a href="http://jayisgames.com/archives/2009/04/scary_girl.php">JayIsGames </a>- only problem is that people just seemed to hate it there! This spurned us on to make the game even better with easier controls (especially under water). We even got featured on <a href="http://www.gamasutra.com/php-bin/news_index.php?story=23715">Gamasutra </a>(thrice) and so did the music/sound designer <a href="http://www.gamasutra.com/news/casual/?story=24016">Luke</a>, even on their <a href="http://www.gamasutra.com/php-bin/news_index.php?story=23240">best game pick list</a>! Kotaku (both AU and US) <a href="http://www.kotaku.com.au/2008/06/meet_scarygirl_the_flashy_lady_from_victoria/">seemed</a> to like us too with a headline "<a href="http://kotaku.com/5212598/go-play-scarygirl">Go Play Scarygirl</a>".</p>
<p>Gamertell put Scarygirl in the <a href="http://www.gamertell.com/gaming/comment/101-free-games-whats-not-to-like/">best 101 free games</a>, calling it "one of the coolest games of 2010".</p>
<p>There are also a whole lot of other places (too numerous to mention / find) that mentioned the work so just a big shout out to all those people I forgot to thank for the promotion!</p>
<h2>And the rest ...</h2>
<p>It's pretty awesome, people are talking about it everywhere it seems. I'll post more links to articles as I see them.</p>
<p><a href="http://www.guttersnipenews.com/2009/10/04/computer-games-reviews-women/">guttersnipenews review</a> - Top of the list of the reviewers favourite games.  A list that includes such greats as Samorost, The Path and Little Wheel.</p>
<p>If you're German (or live in Germany I guess), then you can vote for Scarygirl on the <a href="http://www.mtvgameawards.de/">MTV Game Awards</a>. Not sure what the "working class hero" award means, but we're up there will a very well deserving crowd I must say!</p>
<p>- Tarwin</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/10/scarygirl-awards/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Particles from haxe on the iPhone Simulator</title>
		<link>http://blog.touchmypixel.com/2009/07/particles-from-haxe-on-the-iphone-simulator/</link>
		<comments>http://blog.touchmypixel.com/2009/07/particles-from-haxe-on-the-iphone-simulator/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 16:53:24 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=160</guid>
		<description><![CDATA[Its exciting to see that the haxe C++ target is coming together, Hugh Sanderson who's the brains of the operation must be going grey early with all of the attention he's been getting on the lists. Today I've been looking at getting testing the iphone target, and due to my lack of skills in most [...]]]></description>
			<content:encoded><![CDATA[<p>Its exciting to see that the haxe C++ target is coming together, <a href="http://www.gamehaxe.com" target="_blank">Hugh Sanderson</a> who's the brains of the operation must be going grey early with all of the attention he's been getting on the lists. Today I've been looking at getting testing the iphone target, and due to my lack of skills in most things related to it, working on a mac, compiling on a mac, hating a mac, apologizing to the mac once it started doing its job, xcode, c++, etc, etc. Its taken me quite a while to have the penny drop, but in short IT WORKS!</p>
<p>sorry for the terrible video quality, its my old ericsson phone (maybe i should get an iPhone!??)</p>
<p><a href="http://www.touchmypixel.com/blog_examples/090730%20ParticlesIphone/Video.swf" rel="shadowbox;width=320;height=240"><img src="http://blog.touchmypixel.com/wp-content/uploads/2009/05/iphoneparticles.jpg" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/07/particles-from-haxe-on-the-iphone-simulator/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>haxe&#8217;s 2.04th birthday!</title>
		<link>http://blog.touchmypixel.com/2009/07/haxes-204th-birthday/</link>
		<comments>http://blog.touchmypixel.com/2009/07/haxes-204th-birthday/#comments</comments>
		<pubDate>Sun, 26 Jul 2009 23:35:34 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=153</guid>
		<description><![CDATA[Finally we've got the 2.04 realease of haxe! Its pretty momentus, as i've been waiting for it for about 2 months!
One big thing:  the compiler now officially supports the C++ platform. This includes Linux, Mac, Windows, iPhoneos, iPhonesim support. According to Hugh, there will probably be a few teething issues, but as of now i'd better [...]]]></description>
			<content:encoded><![CDATA[<p>Finally we've got the 2.04 realease of haxe! Its pretty momentus, as i've been waiting for it for about 2 months!</p>
<p>One big thing:  the compiler now officially supports the C++ platform. This includes Linux, Mac, Windows, iPhoneos, iPhonesim support. According to Hugh, there will probably be a few teething issues, but as of now i'd better get out of bed and see what we can make!</p>
<p><a href="http://ncannasse.fr/blog/haxe_2.04?lang=en">Here's what Nicolas has to say about 2.04 </a></p>
<p>The <a href="http://lists.motion-twin.com/pipermail/haxe/2009-July/027679.html">full list of 2.04 changes</a></p>
<p>Cheers,</p>
<p>Tony</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/07/haxes-204th-birthday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deadsun: In development</title>
		<link>http://blog.touchmypixel.com/2009/07/deadsun-in-development/</link>
		<comments>http://blog.touchmypixel.com/2009/07/deadsun-in-development/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 09:57:19 +0000</pubDate>
		<dc:creator>tonyp</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[haxe]]></category>

		<guid isPermaLink="false">http://blog.touchmypixel.com/?p=148</guid>
		<description><![CDATA[We might start throwing up some tests of games we're working on. I hope it will be good to get some feedback - but keep in mind, this IS in development, so go easy ;P
So - whats deadsun? Thats the codename (hah how mysterious!) for my latest game, Tarwin is working on a few other [...]]]></description>
			<content:encoded><![CDATA[<p>We might start throwing up some tests of games we're working on. I hope it will be good to get some feedback - but keep in mind, this IS in development, so go easy ;P</p>
<p>So - whats deadsun? Thats the codename (hah how mysterious!) for my latest game, Tarwin is working on a few other things. It will hopefully be release on the iphone too (hence the format).</p>
<p>The sun is dead, and post apocolyptic radiation is pouring out of the sky. You need to gather it to your cities to power them. In this test, you can play with the mechanic of collecting energy from the black-holes which expel it. There will be more advanced levels to come, which involve protecting the cities, tba.</p>
<p>Use Keys 1-8 to flick between the levels.</p>
<p>NOTE: please view this on its own page (not with all other blog posts) as it probably will run slow otherwise - we are working on fixing this weakness of our blog.</p>
<p><strong>UPDATE - I HAVE TAKEN THIS TEST DOWN UNTIL WE DEVELOP THE GAME</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.touchmypixel.com/2009/07/deadsun-in-development/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
