<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Step by step AS3 translation of Flash game creation tutorial &#8211; part 2</title>
	<atom:link href="http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/</link>
	<description>italian geek and PROgrammer</description>
	<lastBuildDate>Fri, 30 Jul 2010 17:33:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<item>
		<title>By: escorpior</title>
		<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/#comment-570124</link>
		<dc:creator>escorpior</dc:creator>
		<pubDate>Tue, 20 Apr 2010 09:07:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=296#comment-570124</guid>
		<description>Realy nice tutorial, thank you very much.</description>
		<content:encoded><![CDATA[<p>Realy nice tutorial, thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kyle_mantesso</title>
		<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/#comment-285993</link>
		<dc:creator>kyle_mantesso</dc:creator>
		<pubDate>Fri, 26 Sep 2008 14:45:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=296#comment-285993</guid>
		<description>hey just wanted to thank you for all the tutorials! im writting a game in AS3 using the nintendo wiimote for uni and I have found these tutorials very useful, thank you!</description>
		<content:encoded><![CDATA[<p>hey just wanted to thank you for all the tutorials! im writting a game in AS3 using the nintendo wiimote for uni and I have found these tutorials very useful, thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ZealousZephyr</title>
		<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/#comment-233989</link>
		<dc:creator>ZealousZephyr</dc:creator>
		<pubDate>Wed, 16 Jul 2008 20:50:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=296#comment-233989</guid>
		<description>I wrote a function for circle hit tests for a game before.

function circleHitTest(
		circ1:MovieClip,
		circ2:MovieClip,
		extra:Number = 0):Boolean{
	//get distances between two circles
	var dx:Number = circ1.x - circ2.x;
	var dy:Number = circ1.y - circ2.y;
	//get &quot;direct&quot; distance
	var td:Number = Math.sqrt(dx*dx + dy*dy); 
	//if the radius of both circles is
	//larger than the distance, then hit
	if(td &lt; circ1.width/2 + circ2.width/2 + extra){ 
		return true; 
	}
	return false;
}

(I hope the code displays correctly.)
The &quot;extra&quot; parameter is if you want it to register as a hit if they are further away from eachother(I used it in my game to make sure that circles don&#039;t spawn to close to each other).</description>
		<content:encoded><![CDATA[<p>I wrote a function for circle hit tests for a game before.</p>
<p>function circleHitTest(<br />
		circ1:MovieClip,<br />
		circ2:MovieClip,<br />
		extra:Number = 0):Boolean{<br />
	//get distances between two circles<br />
	var dx:Number = circ1.x &#8211; circ2.x;<br />
	var dy:Number = circ1.y &#8211; circ2.y;<br />
	//get &#8220;direct&#8221; distance<br />
	var td:Number = Math.sqrt(dx*dx + dy*dy);<br />
	//if the radius of both circles is<br />
	//larger than the distance, then hit<br />
	if(td &lt; circ1.width/2 + circ2.width/2 + extra){<br />
		return true;<br />
	}<br />
	return false;<br />
}</p>
<p>(I hope the code displays correctly.)<br />
The &#8220;extra&#8221; parameter is if you want it to register as a hit if they are further away from eachother(I used it in my game to make sure that circles don&#8217;t spawn to close to each other).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sorby</title>
		<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/#comment-216100</link>
		<dc:creator>sorby</dc:creator>
		<pubDate>Thu, 03 Jul 2008 16:38:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=296#comment-216100</guid>
		<description>@ Robin W
That has already been taken care of with this code:
coin.x = Math.random()*510+20; //Changes the x of the coin to a random number between 20 and 530.
coin.y = Math.random()*360+20; //Changes the y of the coin to a random number between 20 and 380.


The only problem is that the width of the stage is 500, so if your getting a random number between 510 and 20 there&#039;s a chance the coin may appear off the screen.</description>
		<content:encoded><![CDATA[<p>@ Robin W<br />
That has already been taken care of with this code:<br />
coin.x = Math.random()*510+20; //Changes the x of the coin to a random number between 20 and 530.<br />
coin.y = Math.random()*360+20; //Changes the y of the coin to a random number between 20 and 380.</p>
<p>The only problem is that the width of the stage is 500, so if your getting a random number between 510 and 20 there&#8217;s a chance the coin may appear off the screen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robin W.</title>
		<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/#comment-210897</link>
		<dc:creator>Robin W.</dc:creator>
		<pubDate>Sat, 28 Jun 2008 21:16:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=296#comment-210897</guid>
		<description>@Alex L. 
That has already been taken care of with this code:
coin.x = Math.random()*510+20; //Changes the x of the coin to a random number between 20 and 530.
		coin.y = Math.random()*360+20; //Changes the y of the coin to a random number between 20 and 380.</description>
		<content:encoded><![CDATA[<p>@Alex L.<br />
That has already been taken care of with this code:<br />
coin.x = Math.random()*510+20; //Changes the x of the coin to a random number between 20 and 530.<br />
		coin.y = Math.random()*360+20; //Changes the y of the coin to a random number between 20 and 380.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex L.</title>
		<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/#comment-202637</link>
		<dc:creator>Alex L.</dc:creator>
		<pubDate>Sat, 21 Jun 2008 15:37:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=296#comment-202637</guid>
		<description>One thing you may want to do is make it so the coin cannot appear in the black border, or else it is impossible to get.</description>
		<content:encoded><![CDATA[<p>One thing you may want to do is make it so the coin cannot appear in the black border, or else it is impossible to get.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham</title>
		<link>http://www.emanueleferonato.com/2008/06/21/step-by-step-as3-translation-of-flash-game-creation-tutorial-part-2/#comment-202547</link>
		<dc:creator>Graham</dc:creator>
		<pubDate>Sat, 21 Jun 2008 12:35:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.emanueleferonato.com/?p=296#comment-202547</guid>
		<description>I think, when using circles, you might want to do a radius+radius distance test fro a very accurate hittest.
For example:
var dx = ball.x-coin.x
var dy = ball.y-coin.y
var dis = Math.sqrt(dx*dx+dy*dy)
if (dis &lt; (rad1 + rad2)) {
// it hit
}</description>
		<content:encoded><![CDATA[<p>I think, when using circles, you might want to do a radius+radius distance test fro a very accurate hittest.<br />
For example:<br />
var dx = ball.x-coin.x<br />
var dy = ball.y-coin.y<br />
var dis = Math.sqrt(dx*dx+dy*dy)<br />
if (dis &lt; (rad1 + rad2)) {<br />
// it hit<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
