<?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/"
	xmlns:series="http://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: AS3 Avoider Game Tutorial, Part 2: Multiple Enemies</title>
	<atom:link href="http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/</link>
	<description>I help people make Flash games</description>
	<lastBuildDate>Tue, 31 Jan 2012 16:28:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kristjan</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-18251</link>
		<dc:creator>Kristjan</dc:creator>
		<pubDate>Tue, 31 Jan 2012 09:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-18251</guid>
		<description>&lt;p&gt;Thanks for the reply. 
Yes, I thought of that at first as well, but couldn&#039;t figure out how to check for collision between two enemies. I think I know how now, but I already got around the problem by adding a delay between spawning two enemies. 
My solution wouldn&#039;t work well in an avoider game, but does in my game.
Anyway, thanks again for your help.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the reply. 
Yes, I thought of that at first as well, but couldn&#8217;t figure out how to check for collision between two enemies. I think I know how now, but I already got around the problem by adding a delay between spawning two enemies. 
My solution wouldn&#8217;t work well in an avoider game, but does in my game.
Anyway, thanks again for your help.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael James Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-18242</link>
		<dc:creator>Michael James Williams</dc:creator>
		<pubDate>Mon, 30 Jan 2012 14:03:03 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-18242</guid>
		<description>&lt;p&gt;Hey Kristjan,&lt;/p&gt;

&lt;p&gt;I would suggest that, as soon as you spawn a new enemy, you check to see whether it is colliding with another enemy. If so, simply move it to another place and check it again. Keep doing that till it&#039;s not colliding with any others. Make sense?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Kristjan,</p>

<p>I would suggest that, as soon as you spawn a new enemy, you check to see whether it is colliding with another enemy. If so, simply move it to another place and check it again. Keep doing that till it&#8217;s not colliding with any others. Make sense?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Kristjan</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-17933</link>
		<dc:creator>Kristjan</dc:creator>
		<pubDate>Mon, 23 Jan 2012 16:37:01 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-17933</guid>
		<description>&lt;p&gt;Thanks a lot for this great tutorial! I&#039;ve seen very few tutorials describe good programming practices in AS3 so well.&lt;/p&gt;

&lt;p&gt;I&#039;m making another game based on this and can&#039;t figure out a solution to stop enemies from spawning on top of each-other. Got any ideas? 
I have tanks and other vehicles as the enemies and it doesn&#039;t look very realistic when they are stuck together. :P&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks a lot for this great tutorial! I&#8217;ve seen very few tutorials describe good programming practices in <acronym title="ActionScript 3">AS3</acronym> so well.</p>

<p>I&#8217;m making another game based on this and can&#8217;t figure out a solution to stop enemies from spawning on top of each-other. Got any ideas? 
I have tanks and other vehicles as the enemies and it doesn&#8217;t look very realistic when they are stuck together. <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Stephanie</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-17714</link>
		<dc:creator>Stephanie</dc:creator>
		<pubDate>Fri, 20 Jan 2012 02:29:44 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-17714</guid>
		<description>&lt;p&gt;Yeah, that helps a lot!  Thanks very much :D&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Yeah, that helps a lot!  Thanks very much <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Michael James Williams</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-17701</link>
		<dc:creator>Michael James Williams</dc:creator>
		<pubDate>Thu, 19 Jan 2012 23:34:28 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-17701</guid>
		<description>&lt;p&gt;Hey Stephanie,&lt;/p&gt;

&lt;p&gt;In a way, yes, that&#039;s what we&#039;re doing. Think of variable names as being temporary; they&#039;re like post-it notes. Earlier, when you created the enemy, you stuck a post-it note to it that said &quot;newEnemy&quot;. When you created another enemy, you basically removed the post-it note from the first enemy, and stuck it on the second - so the first has no name.&lt;/p&gt;

&lt;p&gt;That for-each loop goes through every item in the army[] array, one by one. The first enemy it looks at, it slaps a post-it note on it that says &quot;enemy&quot;. This means that any code inside the for-each loop will refer to that specific enemy, the one with the post-it note. At the end of the for-each loop, it takes the post-it note off that item and puts it onto the next one, and so on and so on.&lt;/p&gt;

&lt;p&gt;Hope that helps clear it up!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Stephanie,</p>

<p>In a way, yes, that&#8217;s what we&#8217;re doing. Think of variable names as being temporary; they&#8217;re like post-it notes. Earlier, when you created the enemy, you stuck a post-it note to it that said &#8220;newEnemy&#8221;. When you created another enemy, you basically removed the post-it note from the first enemy, and stuck it on the second &#8211; so the first has no name.</p>

<p>That for-each loop goes through every item in the army[] array, one by one. The first enemy it looks at, it slaps a post-it note on it that says &#8220;enemy&#8221;. This means that any code inside the for-each loop will refer to that specific enemy, the one with the post-it note. At the end of the for-each loop, it takes the post-it note off that item and puts it onto the next one, and so on and so on.</p>

<p>Hope that helps clear it up!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Stephanie</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-17700</link>
		<dc:creator>Stephanie</dc:creator>
		<pubDate>Thu, 19 Jan 2012 21:18:45 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-17700</guid>
		<description>&lt;p&gt;Hey,
Thanks for the awesome tutorial!  But so far, I just don&#039;t get this one line of code:
for each(var enemy:Enemy in army)
{
}
Are we going through and renaming everything in the array enemy?  Because I thought originally they were called newEnemy...sorry, please let me know if you can&#039;t understand my question.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey,
Thanks for the awesome tutorial!  But so far, I just don&#8217;t get this one line of code:
for each(var enemy:Enemy in army)
{
}
Are we going through and renaming everything in the array enemy?  Because I thought originally they were called newEnemy&#8230;sorry, please let me know if you can&#8217;t understand my question.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: G Man</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-17077</link>
		<dc:creator>G Man</dc:creator>
		<pubDate>Mon, 26 Dec 2011 11:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-17077</guid>
		<description>&lt;p&gt;Thanks Dude, you rock :):)
GREAT TUTORIAL I HAVE EVER SEEN&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks Dude, you rock <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> :)
GREAT TUTORIAL I HAVE EVER SEEN</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Pan Optik</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-14711</link>
		<dc:creator>Pan Optik</dc:creator>
		<pubDate>Sat, 01 Oct 2011 12:06:13 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-14711</guid>
		<description>&lt;p&gt;easy and clear!!thank you ;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>easy and clear!!thank you <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Period Three</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-14710</link>
		<dc:creator>Period Three</dc:creator>
		<pubDate>Sat, 01 Oct 2011 10:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-14710</guid>
		<description>&lt;p&gt;Just multiply it, and use round Pan. For example Math.round( Math.random()&lt;em&gt;400 ) will return an integer between 0 and 400. If you want a different range you also add to it. Math.round( Math.random()&lt;/em&gt;200 )+200 will give you a range of 200 - 400.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just multiply it, and use round Pan. For example Math.round( Math.random()<em>400 ) will return an integer between 0 and 400. If you want a different range you also add to it. Math.round( Math.random()</em>200 )+200 will give you a range of 200 &#8211; 400.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Pan Optik</title>
		<link>http://gamedev.michaeljameswilliams.com/2008/09/22/avoider-game-tutorial-2/comment-page-4/#comment-14674</link>
		<dc:creator>Pan Optik</dc:creator>
		<pubDate>Fri, 30 Sep 2011 09:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://gamedev.michaeljameswilliams.com/?p=112#comment-14674</guid>
		<description>&lt;p&gt;Hello,thanks for tutorial,it&#039;great.I have a question:how can you limit the value of math random between two numbers?I mean i need enemies appear randomic but between a certain x1 and a certain x2... Thank you for support :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hello,thanks for tutorial,it&#8217;great.I have a question:how can you limit the value of math random between two numbers?I mean i need enemies appear randomic but between a certain x1 and a certain x2&#8230; Thank you for support <img src='http://gamedev.michaeljameswilliams.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
</channel>
</rss>

