<?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>MochiLand &#187; Game Design</title>
	<atom:link href="http://mochiland.com/category/mochiland/game-design/feed" rel="self" type="application/rss+xml" />
	<link>http://mochiland.com</link>
	<description>for(developer in flash_games){ this.mochiland = _root }</description>
	<lastBuildDate>Sat, 04 Feb 2012 02:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Mochi Community Contribution: Creating Ally AI by Danny Buoncore</title>
		<link>http://mochiland.com/articles/mochi-community-contribution-creating-ally-ai-by-danny-buoncore</link>
		<comments>http://mochiland.com/articles/mochi-community-contribution-creating-ally-ai-by-danny-buoncore#comments</comments>
		<pubDate>Tue, 06 Dec 2011 00:55:01 +0000</pubDate>
		<dc:creator>dannybuoncore</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Developer Spotlight]]></category>
		<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[artificial intelligence]]></category>
		<category><![CDATA[Danny Buonocore]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5916</guid>
		<description><![CDATA[Creating Ally AI That Locates Nearest Enemy and Attacks In this tutorial, you will learn: Basic for loop usage Basic array usage How to find the distance between two points How to use Math.atan2() to have MovieClips follow each other How to fire projectiles How to split a velocity vector into two perpendicular lines using [...]]]></description>
			<content:encoded><![CDATA[ <h1 class="post-title">Creating Ally AI That Locates Nearest Enemy and Attacks</h1>
<h2>In this tutorial, you will learn:</h2>
<ul>
<li>Basic for loop usage</li>
<li>Basic array usage</li>
<li>How to find the distance between two points</li>
<li>How to use Math.atan2() to have MovieClips follow each other</li>
<li>How to fire projectiles</li>
<li>How to split a velocity vector into two perpendicular lines using sine and cosine</li>
<li>How to create objects from custom classes</li>
</ul>
<h4>Introduction</h4>
<p>When learning Actionscript, or any programming language for that matter, I find it best to create specific engines that employ a variety of techniques and functions.  This way, you are not only learning how to use these features, but you are also experiencing a pragmatic use for them.  In this tutorial we will be creating a class for an ally AI that will locate the enemy nearest it, chase it, and shoot it.  This is used in just about any game where there are characters not controlled by the player.  Take, for example, a tower defense game.  The towers created do not simply attack any enemy they want.  They usually attack the closest.  However, there are some games where you can choose to have them attack the quickest enemy, or the one with the most health, or whatever it may be.  But for now let&#8217;s concentrate on distance.</p>
<p>Now, what if there are three allies (let&#8217;s call them followers for now) and two enemies, one of which is really far away?  The tutorial you are about to read is designed so that rather than all three followers clustering up on the closest enemy, two will attack it and the third will set off for the far one.  Furthermore, what happens when a third enemy is spawned when all this is going on?  Well, rather than the follower by itself (which may be closer) going out to attack it, one of the two that are attacking the same enemy will leave and target the newfound enemy.  This optimizes the strategy of the followers so no enemy is left alone while there is a surplus of followers elsewhere.</p>
<p>Rather than just talking about what we&#8217;re going to do, let&#8217;s actually do it.  Sometimes I prefer to just see the source code and play around with it rather than just following a tutorial.  If you want, you may download a heavily-commented copy of all the code down below.  Without further ado, let&#8217;s begin the tutorial.</p>
<p><object id="test1" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="400" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"><param name="movie" value="http://www.swfup.com/swf/e5z3.swf" /><embed type="application/x-shockwave-flash" width="640" height="400" src="http://www.swfup.com/swf/e5z3.swf" name="Follow" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object></p>
<p><a href="http://www.mediafire.com/?xhhbm1ovehio8ag">Download Source</a></p>
<h4>Step 1: Setting Up the MovieClips</h4>
<p>There are three MovieClips essential to this tutorial.  First, we need the followers and the enemies.  We also need some sort of projectile or bullet for the followers to shoot.  For the sake of example, I am programming this tutorial in a way that the user can create followers and enemies by clicking buttons at the bottom of the stage.  So now we&#8217;re up to five MovieClips.  Name them Bee, EnemyBee, Ball, BeeButton, and EnemyButton.  Below are my five MovieClips in their respective order:</p>
<p><img src="http://img337.imageshack.us/img337/6232/movieclips.jpg" alt="MovieClips" /></p>
<p>When saving each as a symbol, be sure to check the &#8220;Export for Actionscript&#8221; box and keep the class name the same.</p>
<h4>Step 2: The Arrays</h4>
<p>Now that we have our MovieClips, we need a place to store them.  Open up the Main Timeline&#8217;s Actions Panel (F9) and input the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> beeArray=<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> eArray=<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> ballArray=<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>What&#8217;s happening here is we are creating three arrays to store our objects: one for all the bees (followers), one for all the enemies, and one for all the balls being shot.  These arrays are going to be accessed a ton of times throughout the tutorial, so if you need to brush up on any of the arrays basics be sure to check out this <a href="http://active.tutsplus.com/tutorials/actionscript/as3-101-arrays/">tutorial</a></p>
<h4>Step 3: The Enemies</h4>
<p>The enemies are much easier to program, so we&#8217;ll start with them first.  Create a new custom class called EnemyBee (or whatever necessary to match the name of your enemy MovieClip) and start off with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MovieClip</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> EnemyBee <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">MovieClip</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> r<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">angle</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> rot<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> health<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speedX<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speedY<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> dist<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> reload<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//reload timer for shooting (don't worry about this for now)</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> isTarget<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> EnemyBee<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> beginClass<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> beginClass<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
r=<span style="color: #004993;">MovieClip</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">root</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> eFrame<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span>=<span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageWidth</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span>=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">400</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000; font-weight:bold;">20</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> h<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #004993;">stage</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #004993;">angle</span>=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">atan2</span><span style="color: #000000;">&#40;</span>h<span style="color: #000066; font-weight: bold;">-</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">,-</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>speedX=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">cos</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>speedY=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">sin</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span>=<span style="color: #004993;">angle</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PI</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">180</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
rot=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">random</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000; font-weight:bold;">4</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> eFrame<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Now this is a lot of code all at once so let&#8217;s go through it line by line.  Lines 6-13 declare variables which are more or less self-explanatory.  The main one to note here is the public variable isTarget.  This variable isn&#8217;t accessed at all by EnemyBee, but from the followers.  It is used to tell how many bees are following the EnemyBee.  But let&#8217;s move on for now.</p>
<p>In the beginClass function, line 20 places EnemyBee inside eArray (on the Main Timeline) through the use of r (the root of the MovieClip).  Below, the initial x and y coordinates are set to be just off the right side of the stage anywhere from the top to the bottom.  Variable h is the destination of EnemyBee and, using Math.random(), is different every time.  The next line uses a function called Math.atan2().  Most of you trigonometry aficionados know that the atan2 function, being a variant of the arctangent function, returns the angle (in radians) between the positive x axis of a plane and the point constructed by the given coordinates.  For now, all you need to know are the parameters.  They are as follows:</p>
<p><span> Math.atan2(destinationY-this.y , destinationX-this.x);</span></p>
<p>It seems strange, but just remember the y comes first.  By using the atan2 function we now know the angle between the point EnemyBee is going for (in this case h) and itself.  But how do we make it so that our object moves towards it?  That&#8217;s where the sine and cosine lines come in.  By taking the cosine of the angle we can find the horizontal speed the object must take.  Similarly, we can use sine to find the vertical speed.  You can replace the 2 at the end of each line with a larger or smaller number to increase or decrease the speed (respectively).  Finally, we rotate the object to face its target once again using angle, and then assign rot (the rotational speed) a random number from 0-3.99999 (this is used later on).</p>
<p>Now we can edit the eFrame function.  So within the brackets, place this code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">+</span>=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>speedX<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>health<span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">+</span>=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>speedY<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">splice</span><span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
removeMe<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">splice</span><span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span><span style="color: #000066; font-weight: bold;">+</span>=<span style="color: #000000; font-weight:bold;">5</span><span style="color: #000066; font-weight: bold;">+</span>rot<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">+</span>=<span style="color: #000000; font-weight:bold;">3</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">3</span><span style="color: #000066; font-weight: bold;">-</span>rot<span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>y<span style="color: #000066; font-weight: bold;">-</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>width<span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;;</span>stage<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">stageHeight</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
removeMe<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>First, the object moves horizontally.  Next, if its health is greater than zero (meaning it is not dead) it will also move vertically and if it manages to survive the followers and go offstage to the left, remove itself from eArray, and then call the removeMe() function which we will declare in a little bit.  In case EnemyBee IS defeated, however, it will first check to see if its index in eArray is at least 0.  A useful fact about arrays is that &#8220;if&#8221; an object isn&#8217;t in the array at all, its index is -1.  Through this &#8220;if statement&#8221; we are effectively checking to see if EnemyBee is in eArray so we don&#8217;t accidentally remove it twice (that would result in an error).  The next few lines are pretty much self-explanatory.</p>
<p>The last piece of code for EnemyBee is the removeMe() function.  Here it is:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> removeMe<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> eFrame<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This last part is easy.  First the event listener is removed, and then the object itself is deleted.  That&#8217;s all we need for EnemyBee.  Now we can start the hard stuff! (:</p>
<h4>Step 4: The Followers</h4>
<p>Now it&#8217;s time to get to the heart of the tutorial: creating the followers.  Create a new custom class for your followers (in this case it&#8217;s called Bee), and input this code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
 	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MovieClip</span><span style="color: #000066; font-weight: bold;">;</span>
 	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
 	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Bee <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">MovieClip</span> <span style="color: #000000;">&#123;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> r<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">max</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MAX_VALUE</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speedX<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speedY<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speed<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">angle</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> reload<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Bee<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
   	<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> beginClass<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #000000;">&#125;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> beginClass<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
   	r=<span style="color: #004993;">MovieClip</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">root</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
   	<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> eFrame<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
   	r<span style="color: #000066; font-weight: bold;">.</span>beeArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
   	<span style="color: #004993;">x</span>=<span style="color: #000000; font-weight:bold;">275</span><span style="color: #000066; font-weight: bold;">;</span>
   	<span style="color: #004993;">y</span>=<span style="color: #000000; font-weight:bold;">245</span><span style="color: #000066; font-weight: bold;">;</span>
  	<span style="color: #000000;">&#125;</span>
  	<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> eFrame<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
  	<span style="color: #000000;">&#125;</span>
 	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>You&#8217;ve seen all this code already in EnemyBee so I&#8217;m not going to explain it all again.  The only exceptions are c (which will be explained in a bit) and Number.MAX_VALUE, which can simply be thought of as infinity.</p>
<p>There&#8217;s a lot of code in the eFrame event, so let&#8217;s do it all in pieces.  First, we need this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">!</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #009900; font-style: italic;">//paste all the following code here</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This line of code tells us if there are any enemies on stage or not.  Without it, we would get errors.  Within the brackets, place this first bunch of code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">c</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if c is NOT in eArray...</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//for every object in eArray...</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> obj=r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign address of object to obj</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> distX<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>x<span style="color: #000066; font-weight: bold;">-</span>obj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//horizontal distance between self and obj (the enemy)</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> distY<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>y<span style="color: #000066; font-weight: bold;">-</span>obj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//vertical distance between self and obj (the enemy)</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> dist<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #000000;">&#40;</span>distX<span style="color: #000066; font-weight: bold;">*</span>distX<span style="color: #000066; font-weight: bold;">+</span>distY<span style="color: #000066; font-weight: bold;">*</span>distY<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//overall distance using distance formula</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>dist<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>max<span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span>obj<span style="color: #000066; font-weight: bold;">.</span>isTarget==<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if distance &amp;lt; max and obj has no followers...</span>
&nbsp;
<span style="color: #004993;">max</span>=dist<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign distance to max (the new shorst distance)</span>
&nbsp;
<span style="color: #004993;">c</span>=obj<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign address of object currently being tested in c</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">c</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if c is in eArray...</span>
&nbsp;
<span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span>isTarget<span style="color: #000066; font-weight: bold;">++;</span> <span style="color: #009900; font-style: italic;">//tell c (EnemyBee) that one more bee is following it</span>
&nbsp;
<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if c is NOT in eArray...</span>
&nbsp;
<span style="color: #004993;">max</span>=<span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MAX_VALUE</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//reset max to maximum value</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> j<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> j<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">;</span> j<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//for every object in eArray...</span>
&nbsp;
obj=r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign address of object to obj</span>
&nbsp;
distX=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>x<span style="color: #000066; font-weight: bold;">-</span>obj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//horizontal distance between self and obj (the enemy)</span>
&nbsp;
distY=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>y<span style="color: #000066; font-weight: bold;">-</span>obj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//vertical distance between self and obj (the enemy)</span>
&nbsp;
dist=<span style="color: #000000;">&#40;</span>distX<span style="color: #000066; font-weight: bold;">*</span>distX<span style="color: #000066; font-weight: bold;">+</span>distY<span style="color: #000066; font-weight: bold;">*</span>distY<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//overall distance using distance formuala</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>dist<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if distance is closer than max...</span>
&nbsp;
<span style="color: #004993;">max</span>=dist<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign distance to max (the new shortest distance)</span>
&nbsp;
<span style="color: #004993;">c</span>=obj<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign address of object currently being tested in c</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span>isTarget<span style="color: #000066; font-weight: bold;">++;</span> <span style="color: #009900; font-style: italic;">//tell c (EnemyBee) that one more bee is following it</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>It can get a little confusing at this point, so I included plenty of comments.  The variable c is used to hold the address of the closest enemy (hence it&#8217;s name).  First we check to see if it is not in the array (meaning the closest enemy has not been determined).  We use a for loop to iterate through all the enemies in eArray.  If you&#8217;re new to loops, you can read up on them <a href="http://active.tutsplus.com/tutorials/actionscript/as3-101-loops/">here</a>.</p>
<p>Next we instantiate four variables:  a placeholder for the object being tested, the horizontal distance, the vertical distance, and the total distance.  Just in case you are wondering, the distance formula is as follows:</p>
<p><img src="http://upload.wikimedia.org/wikipedia/en/math/f/0/a/f0a4a3d633ef96d31f068e387cd91fc2.png" alt="Distance Formula" /></p>
<p>Now that we know the distance of the object being checked, we must see if it is closer than the previous.  Recall that max was equal to Number.MAX_VALUE, so it is greater than anything we could compare it to.  So the first instance to be checked will definitely be closer, and the if statement will be true.  Therefore, max is set to the distance between itself and the enemy being tested (the new shortest distance), and obj is stored in c.  All that happened for the first enemy in eArray.  Now go through it again for the second enemy.  The second enemy is stored in obj, just like the first, and the distance is established.  However, instead of max being equal to the highest value, it is equal to the distance of the previous enemy.  If the distance between the bee and the enemy being tested is shorter than that of the first enemy, max is lowered again to match the distance and the enemy is stored in c.  If not, the loop skips over this and goes on to test the next enemy.  This process continues for every enemy in the array.  Logically, the value of max by the time all of the enemies are done being tested will be equal to the shortest distance, and c will hold the address for the corresponding enemy.</p>
<p>Note that with the if statement, Bee only looks for enemies that have isTarget==0.  In plain English, that means it only takes enemies that are not being followed into consideration.  This way we don&#8217;t have that surplus of followers in one section and a non-followed enemy elsewhere like we previously discussed.  However, there is the case that every enemy is already being followed.  The if statement right after the for loop checks to see if a closest enemy (with no followers) has been found.  If so, it increases the value of isTarget on the enemy (amount of followers).  If not, another for loop extremely similar to the previous is carried out.  The only difference is the if statement:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>dist<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span></pre></div></div>

<p>Instead of checking to be sure the enemy being tested has no followers, it just looks for the closest.  I found this to be the best design, but you might have another use for it.  This code is very easy to customize.  Say you wanted locate the enemy with the least amount of followers.  You could simply substitute the if statement for this:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>obj<span style="color: #000066; font-weight: bold;">.</span>isTarget<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #004993;">max</span>=obj<span style="color: #000066; font-weight: bold;">.</span>isTarget<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #004993;">c</span>=obj<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>All right we&#8217;re getting closer to finishing this up.  One more loop:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">max</span>=<span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MAX_VALUE</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//reset max to maximum value</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span>length<span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span>=r<span style="color: #000066; font-weight: bold;">.</span>beeArray<span style="color: #000066; font-weight: bold;">.</span>length<span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span>c<span style="color: #000066; font-weight: bold;">.</span>isTarget<span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if c has other followers...</span>
&nbsp;
<span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span>isTarget<span style="color: #000066; font-weight: bold;">--;</span> <span style="color: #009900; font-style: italic;">//tell c it has one fewer follower</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> l<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> l<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">;</span> l<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//for every object in eArray...</span>
&nbsp;
obj=r<span style="color: #000066; font-weight: bold;">.</span>eArray<span style="color: #000000;">&#91;</span>l<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign address of object to obj</span>
&nbsp;
distX=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>x<span style="color: #000066; font-weight: bold;">-</span>obj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//horizontal distance between self and obj (the enemy)</span>
&nbsp;
distY=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>y<span style="color: #000066; font-weight: bold;">-</span>obj<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//vertical distance between self and obj (the enemy)</span>
&nbsp;
dist=<span style="color: #000000;">&#40;</span>distX<span style="color: #000066; font-weight: bold;">*</span>distX<span style="color: #000066; font-weight: bold;">+</span>distY<span style="color: #000066; font-weight: bold;">*</span>distY<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//overall distance using distance formula</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>dist<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>max<span style="color: #000066; font-weight: bold;">&amp;</span>amp<span style="color: #000066; font-weight: bold;">;&amp;</span>amp<span style="color: #000066; font-weight: bold;">;</span>obj<span style="color: #000066; font-weight: bold;">.</span>isTarget==<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if distance &amp;lt; max and obj has no followers...</span>
&nbsp;
<span style="color: #004993;">max</span>=dist<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign distance to max (the new shortest distance)</span>
&nbsp;
<span style="color: #004993;">c</span>=obj<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//assign address of object currently being tested in c</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span>isTarget<span style="color: #000066; font-weight: bold;">++;</span> <span style="color: #009900; font-style: italic;">//tell c (EnemyBee) that one more bee is following it</span>
&nbsp;
<span style="color: #004993;">max</span>=<span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MAX_VALUE</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//reset max to maximum value</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Okay so after doing two loops almost exactly like this one, no explanation should be necessary.  However, a brief discourse on the logic behind it should help.  The only thing different here than the first loop is that it is only executed when there are more enemies than followers and the enemy the bee is following has at least one other follower.  You may be asking yourself why I chose to create three loops that are almost identical instead of simply making a function called several times with slightly different arguments.  Well, I think it&#8217;s easier to retain the information if you see it several times.  Plus, a tutorial is never complete unless something is left up to you to figure out yourself.</p>
<p>All right, now that the difficult part is out of the way, we can move on to actually moving the bee.  The code below immediately follows the if statement above:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">angle</span>=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">atan2</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span>y<span style="color: #000066; font-weight: bold;">-</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span>x<span style="color: #000066; font-weight: bold;">-</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//angle between self and closest enemy</span>
&nbsp;
speedX=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">cos</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>speed<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//find horizontal speed according to angle</span>
&nbsp;
speedY=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">sin</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>speed<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//find vertical speed according to angle</span>
&nbsp;
<span style="color: #004993;">rotation</span>=<span style="color: #004993;">angle</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PI</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">180</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//rotate to face enemy</span>
&nbsp;
distX=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>x<span style="color: #000066; font-weight: bold;">-</span><span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//horizontal distance between self and closest enemy</span>
&nbsp;
distY=<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>y<span style="color: #000066; font-weight: bold;">-</span><span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//vertical distance between self and closest enemy</span>
&nbsp;
dist=<span style="color: #000000;">&#40;</span>distX<span style="color: #000066; font-weight: bold;">*</span>distX<span style="color: #000066; font-weight: bold;">+</span>distY<span style="color: #000066; font-weight: bold;">*</span>distY<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//overall distance using distance formula</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>dist<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>=<span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if distance is less than or equal to 100...</span>
&nbsp;
speed=<span style="color: #000066; font-weight: bold;">-.</span>1<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//slow down</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>speed<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if speed is less than 0...</span>
&nbsp;
speed=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//keep speed at 0</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if distance is greater than 100...</span>
&nbsp;
speed<span style="color: #000066; font-weight: bold;">+</span>=<span style="color: #000066; font-weight: bold;">.</span>1<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//speed up</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>speed<span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if speed is greater than 2...</span>
&nbsp;
speed=<span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//keep speed at 2</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">+</span>=speedX<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//move horizontally</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">+</span>=speedY<span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//move vertically</span></pre></div></div>

<p>This is very similar to the motion employed in the EnemyBee class and shouldn&#8217;t be too difficult at all.  The if and else statements are purely for aesthetic purposes so that the bee doesn&#8217;t sit directly on the enemy.</p>
<p>That concludes the code for the followers.  Now all we need is a means to create the followers and enemies.  I&#8217;m sure you will come up with plenty of ways that pertain to your game, but for the sake of convenience I just created two buttons that allow the user to spawn them.  If you&#8217;d like to see the Actionscript for this, download the source code files from above.</p>
<h4>Step 5: Shooting</h4>
<p>Run your .swf.  If you did it right, you should get something like this:</p>
<p>The bees follow the enemies just like we programmed them to, but they do not attack.  Remember that Ball Movieclip we make at the beginning of the tutorial?  Well we&#8217;re finally going to use it.  Open up the custom class for Ball and type this in:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.display</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">MovieClip</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span><span style="color: #000066; font-weight: bold;">.*;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Ball <span style="color: #0033ff; font-weight: bold;">extends</span> <span style="color: #004993;">MovieClip</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> r<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">c</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">15</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> id2<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">angle</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speedX<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speedY<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> speed<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>=<span style="color: #000000; font-weight:bold;">8</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> mc<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Ball<span style="color: #000000;">&#40;</span>id<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">uint</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ADDED_TO_STAGE</span><span style="color: #000066; font-weight: bold;">,</span> beginClass<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
id2=id<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> beginClass<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
r=<span style="color: #004993;">MovieClip</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">root</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> eFrame<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
mc=r<span style="color: #000066; font-weight: bold;">.</span>beeArray<span style="color: #000000;">&#91;</span>id2<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//find which object created it</span>
&nbsp;
<span style="color: #004993;">angle</span>=mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PI</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">180</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span>=mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//set x coordinate to that of bee's</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span>=mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//set y coordinate to that of bee's</span>
&nbsp;
speedX=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">cos</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>speed<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
speedY=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">sin</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>speed<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setChildIndex</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span>r<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getChildIndex</span><span style="color: #000000;">&#40;</span>mc<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> eFrame<span style="color: #000000;">&#40;</span>event<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">+</span>=speedX<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">+</span>=speedY<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>c<span style="color: #000066; font-weight: bold;">&amp;</span>gt<span style="color: #000066; font-weight: bold;">;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
c<span style="color: #000066; font-weight: bold;">--;</span>
&nbsp;
<span style="color: #000000;">&#125;</span> <span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>alpha<span style="color: #000066; font-weight: bold;">-</span>=<span style="color: #000066; font-weight: bold;">.</span>1<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>alpha<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
removeBall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> removeBall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #004993;">removeEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">ENTER_FRAME</span><span style="color: #000066; font-weight: bold;">,</span> eFrame<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span>ballArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">splice</span><span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>ballArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">,</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">removeChild</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>Basically we&#8217;re just creating an object that follows a straight line path using the rotation of the bee it&#8217;s coming from.  The address of the bee is determined by the parameter id2, which we will explain it a bit.  Now we have to program Bee to actually shoot the balls.  In the eFrame event of Bee, right after the speedX and speedY are used, place the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">reload<span style="color: #000066; font-weight: bold;">--;</span> <span style="color: #009900; font-style: italic;">//lower reload timer</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>reload==<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if reload is complete...</span>
&nbsp;
reload=<span style="color: #000000; font-weight:bold;">50</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//reset reload timer to 50</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> newBall<span style="color: #000066; font-weight: bold;">:</span>Ball=<span style="color: #0033ff; font-weight: bold;">new</span> Ball<span style="color: #000000;">&#40;</span>r<span style="color: #000066; font-weight: bold;">.</span>beeArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">indexOf</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//create new ball</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">addChild</span><span style="color: #000000;">&#40;</span>newBall<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//add ball to stage</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span>ballArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>newBall<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//put ball in ballArray</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>This creates a new instance of the Ball class and places it in the corresponding array on the Main Timeline.  As you can see, the argument incorporated while instantiating the new ball is the index of the bee in its array.  This is then later accessed by the ball in its class to find where it should be placed on the stage and the angle it should follow:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">mc=r<span style="color: #000066; font-weight: bold;">.</span>beeArray<span style="color: #000000;">&#91;</span>id2<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//find which object created it</span>
&nbsp;
<span style="color: #004993;">angle</span>=mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">rotation</span><span style="color: #000066; font-weight: bold;">*</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">PI</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">180</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span>=mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//set x coordinate to that of bee's</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span>=mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">//set y coordinate to that of bee's</span>
&nbsp;
speedX=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">cos</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>speed<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
speedY=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">sin</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">angle</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">*</span>speed<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
r<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">setChildIndex</span><span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span>r<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">getChildIndex</span><span style="color: #000000;">&#40;</span>mc<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>The address of the bee is found using id2 (which is equal to the argument we just mentioned) and stored in mc, which is used to set all that good stuff above.  The setChildIndex() statement is used so that the ball appears below the bee, giving the illusion that it&#8217;s being shot by the bee, and not appearing right on top of it.</p>
<p>Okay so run your .swf again and you should see this:</p>
<p>Pretty good, huh?  Now we just have more step: the collisions.</p>
<h4>Step 6: The Collisions</h4>
<p>This part is easy.  Simply open up the class file for EnemyBee and, in the first line of the eFrame event, put in the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> i<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span>=<span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;</span>r<span style="color: #000066; font-weight: bold;">.</span>ballArray<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">length</span><span style="color: #000066; font-weight: bold;">;</span> i<span style="color: #000066; font-weight: bold;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> mc<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span>=r<span style="color: #000066; font-weight: bold;">.</span>ballArray<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
dist=<span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span>mc<span style="color: #000066; font-weight: bold;">.</span>x<span style="color: #000066; font-weight: bold;">-</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">+</span><span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">abs</span><span style="color: #000000;">&#40;</span>mc<span style="color: #000066; font-weight: bold;">.</span>y<span style="color: #000066; font-weight: bold;">-</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>dist<span style="color: #000066; font-weight: bold;">&amp;</span>lt<span style="color: #000066; font-weight: bold;">;;</span>this<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">+</span>mc<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">/</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #009900; font-style: italic;">//if they touch...</span>
&nbsp;
health<span style="color: #000066; font-weight: bold;">--;</span>
&nbsp;
mc<span style="color: #000066; font-weight: bold;">.</span>removeBall<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>It&#8217;s just a for loop that iterates over every instance in the ball array and tests for a collision.  You can use whatever collision-detection technique you want, but for this example the best choice is a simple circle-to-circle test.  Upon each collision, the health of the bee is lowered, and the ball is removed through the function removeBall().</p>
<p>Well, that&#8217;s about it.  Test your .swf and it should work just as my example up above did.  This technique is very useful and I&#8217;m sure you&#8217;ll find plenty of ways to use it in your games.  If you make something cool, I&#8217;d love to see it (: Thanks for reading!</p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; dannybuoncore for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/mochi-community-contribution-creating-ally-ai-by-danny-buoncore">Permalink</a> |
	  <a href="http://mochiland.com/articles/mochi-community-contribution-creating-ally-ai-by-danny-buoncore#comments">2 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/mochi-community-contribution-creating-ally-ai-by-danny-buoncore&amp;title=Mochi Community Contribution: Creating Ally AI by Danny Buoncore">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/mochi-community-contribution-creating-ally-ai-by-danny-buoncore" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/developer-spotlight" title="View all posts in Developer Spotlight" rel="category tag">Developer Spotlight</a>, <a href="http://mochiland.com/category/mochiland/flash" title="View all posts in Flash Development" rel="category tag">Flash Development</a>, <a href="http://mochiland.com/category/mochiland/front-page" title="View all posts in Front Page" rel="category tag">Front Page</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/mochi-community-contribution-creating-ally-ai-by-danny-buoncore/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Mochi Ads &amp; Scores to a Stencyl Game</title>
		<link>http://mochiland.com/articles/adding-mochi-ads-scores-to-a-stencyl-game</link>
		<comments>http://mochiland.com/articles/adding-mochi-ads-scores-to-a-stencyl-game#comments</comments>
		<pubDate>Mon, 28 Nov 2011 16:00:20 +0000</pubDate>
		<dc:creator>JonathanChung</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[Stencyl]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5755</guid>
		<description><![CDATA[Mochi Media is one of the most popular ways for Flash game developers to make money with their games using  their in-game ads product Mochi Ads. Mochi is also a one-stop solution for game analytics, achievements, leaderboards, and virtual currency. StencylWorks is an easy way to visually create Flash and iOS games for non-coders and [...]]]></description>
			<content:encoded><![CDATA[ <p>Mochi Media is one of the most popular ways for Flash game developers to make money with their games using  their in-game ads product <strong>Mochi Ads</strong>. Mochi is also a one-stop solution for game analytics, achievements, leaderboards, and virtual currency.</p>
<div class="entry-content">
<p><strong>StencylWorks</strong> is an easy way to visually create Flash and iOS games for non-coders and programmers alike. Starting with StencylWorks 1.2, developers can add Mochi Ads and scores to their games in just a few minutes!</p>
<h3 style="text-align: center;"><strong><a href="http://static.stencyl.com/content/Balloons.zip">Download the Sample Game</a></strong>&nbsp;</p>
<p><em>(Unzip and place “Balloons” folder under the StencylWorks “games” directory.)</em></h3>
<p>This balloon-popping game records how long it took for you to beat the (only) level. We’ll use Mochi to record the score on a leaderboard and show an ad after clicking the reset button.</p>
<h3>Sign up on Mochi’s Site</h3>
<p><a href="https://www.mochimedia.com/register/">Sign up on Mochi’s site</a> if you haven’t done so already.</p>
<h3>Add a Game on Mochi’s Site</h3>
<p>Each game you wish to support you must add to Mochi’s site.</p>
<p>1) Click the “Add Game” tab</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.31.30-PM.png"><img class="alignnone size-full wp-image-382" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.31.30-PM.png" alt="" width="103" height="46" /></a></p>
<p>2) Fill in the page as shown below and submit.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.32.58-PM.png"><img class="alignnone size-full wp-image-383" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.32.58-PM.png" alt="" width="230" height="245" /></a></p>
<p>Stencyl games don’t function with Live Updates at this time.</p>
<p>&nbsp;</p>
<h3>Locate the game’s Mochi Game ID</h3>
<p>Every game has a unique game ID, so Mochi can identify it and store all of its data in one place. You can find the Game ID box on the game’s page.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.35.02-PM.png"><img class="alignnone size-full wp-image-384" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.35.02-PM.png" alt="" width="165" height="94" /></a></p>
<p>To reach a game’s page, visit the Dashboard and click on the game’s name.</p>
<p>&nbsp;</p>
<h3>Enter the Mochi Game ID in to your game</h3>
<p>Now that you’ve set your game up on Mochi’s site, you need to enter in the game’s ID so it can establish a connection with Mochi’s servers to present ads and scores.</p>
<p>1) Open your game in StencylWorks.</p>
<p>2) Click on Advanced Settings under the Game Center tab. Enter the game’s Mochi Game ID.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.38.16-PM.png"><img class="alignnone size-medium wp-image-385" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.38.16-PM-300x211.png" alt="" width="300" height="211" /></a></p>
<p>3) Save your game.</p>
<p>&nbsp;</p>
<h3>How to Display a Mochi Ad</h3>
<p>Displaying an ad is simple. Add the “show Mochi ad” block precisely at the time you wish to show the ad.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.40.19-PM.png"><img class="aligncenter size-full wp-image-402" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.40.19-PM.png" alt="" width="262" height="36" /></a></p>
<p>For our Balloon game, we want to <strong>show an ad after clicking the reset button</strong>.</p>
<p>1) Open up the “MochiAd” behavior under Game Center &gt; Logic &gt; Scene Behaviors</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.45.18-PM.png"><img class="aligncenter size-medium wp-image-405" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.45.18-PM-300x109.png" alt="" width="300" height="109" /></a></p>
<p>This behavior instructs the game to display the ad right away. Our approach in this game is to set up a separate scene exclusively for displaying the ad, so that the ad doesn’t disrupt regular gameplay.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.38.02-PM.png"><img class="aligncenter size-medium wp-image-401" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.38.02-PM-300x70.png" alt="" width="300" height="70" /></a></p>
<p>2) To make this behavior work, we need to attach it to a scene. Click “Attach to Scene” and choose “Ad Scene.”</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.37.18-PM.png"><img class="aligncenter size-medium wp-image-400" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.37.18-PM-300x219.png" alt="" width="300" height="219" /></a></p>
<p>3) Save and run the game. Notice the ad now appears after you click the Reset Button.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.36.02-PM.png"><img class="aligncenter size-medium wp-image-399" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.36.02-PM-300x188.png" alt="" width="300" height="188" /></a></p>
<p>(Get an error? Jump to the bottom. Ad is a little slow in showing up? That’s normal when testing offline.)</p>
<p>&nbsp;</p>
<h3>How to Submit a Score and Display a Leaderboard</h3>
<p>Displaying a leaderboard requires setting up the leaderboard first on Mochi’s site.</p>
<p>1) Visit the Scores page for your game by clicking “Scores” in the sidebar.</p>
<p>2) Click “Add Leaderboard” – it’s a small button on the right-hand side of the page.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.45.39-PM.png"><img class="alignnone size-full wp-image-386" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-28-at-10.45.39-PM.png" alt="" width="120" height="29" /></a></p>
<p>3) Fill in an appropriate title. Leave the rest of the fields as-is and submit.</p>
<p>4) Click on the “actionscript code” link on the next page.</p>
<p>5) Look for “Leaderboard Id” and copy it to your clipboard – this is what you’ll enter in to StencylWorks.</p>
<p>6) Now, open up the “MochiScores” behavior under Game Center &gt; Logic &gt; Scene Behaviors.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.46.44-PM.png"><img class="aligncenter size-medium wp-image-406" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.46.44-PM-300x85.png" alt="" width="300" height="85" /></a></p>
<p>7) Locate the “submit score” block that’s already placed. Provide the Leaderboard Id you found in Step 5. For this game, we are recording how many seconds it took for you to pop all 40 balloons.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.41.48-PM.png"><img class="aligncenter size-full wp-image-403" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.41.48-PM.png" alt="" width="484" height="75" /></a></p>
<p>8) To make this behavior work, we need to attach it to a scene. Click “Attach to Scene” and choose “First”</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.51.47-PM.png"><img class="aligncenter size-medium wp-image-407" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.51.47-PM-300x219.png" alt="" width="300" height="219" /></a></p>
<p>9) Save and run the game. The game will now show the leaderboard after finishing the level.</p>
<p><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.43.23-PM.png"><img class="aligncenter size-medium wp-image-404" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-8.43.23-PM-300x188.png" alt="" width="300" height="188" /></a></p>
<p>(Get an error? Jump to the bottom.)</p>
<h3>&nbsp;</p>
<p>What’s Next?</h3>
<p>Now that you’ve learned how to add scores and ads to your games, what’s next?</p>
<p><strong>Get Your Game Approved by Mochi</strong></p>
<p>You won’t start making money off those ads until your game’s been approved by Mochi. To get approval, you need to test game locally to present an ad and fill out your game profile on Mochi’s site. Mochi approves most games within 24 hours.</p>
<p><strong>Let Mochi Distribute Your Game</strong></p>
<p>Mochi not only maintains an ad network and APIs for its games, it also maintains a distribution network for Flash games, so your game can reach more players. It does this by offering feeds and embeddable “arcade” widgets that website owners can embed in their sites to present games relevant to their site.</p>
<p>To participate in this program, visit your game through the Dashboard and locate this box.</p>
<p style="text-align: center;"><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-9.06.07-AM.png"><img class="size-full wp-image-395 aligncenter" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-9.06.07-AM.png" alt="" width="394" height="107" /></a></p>
<h3>Troubleshooting: What to do if ads and scores do not show up, or if you receive an error.</h3>
<p>If you are testing locally, and want to be able to see ads or scores, you may need to do the following.</p>
<p>Add the location of your development files to your global security settings in the <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.html" target="_blank">Adobe Flash Player Settings Manager</a>. This way, you can give all SWF files in this location <em>local-trusted</em> access, allowing access to both local and remote data.</p>
<p>The folder you want to add is the entire StencylWorks folder. This will catch everything underneath it, including the game itself. If you’ve chosen a custom workspace, you also need to add the folder for that.</p>
<p style="text-align: center;"><a href="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-9.21.22-AM.png"><img class="aligncenter size-full wp-image-396" style="border: 0px;" src="http://blog.stencyl.com/wp-content/uploads/2011/10/Screen-shot-2011-10-31-at-9.21.22-AM.png" alt="" width="405" height="279" /></a></p>
<p>&nbsp;</p>
<h2 style="text-align: center;"><a href="http://community.stencyl.com/index.php/topic,4308.0.html"></a><strong><a href="http://community.stencyl.com/index.php/topic,4308.0.html">Discuss this Article on our Forums!</a></strong></h2>
</div>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; JonathanChung for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/adding-mochi-ads-scores-to-a-stencyl-game">Permalink</a> |
	  <a href="http://mochiland.com/articles/adding-mochi-ads-scores-to-a-stencyl-game#comments">No comment</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/adding-mochi-ads-scores-to-a-stencyl-game&amp;title=Adding Mochi Ads &amp; Scores to a Stencyl Game">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/adding-mochi-ads-scores-to-a-stencyl-game" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/flash" title="View all posts in Flash Development" rel="category tag">Flash Development</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>, <a href="http://mochiland.com/category/mochiland/tutorials" title="View all posts in Tutorials" rel="category tag">Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/adding-mochi-ads-scores-to-a-stencyl-game/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash Game Friday Winner: Prizma Puzzle Challenges</title>
		<link>http://mochiland.com/articles/flash-game-friday-winner-prizma-puzzle-challenges</link>
		<comments>http://mochiland.com/articles/flash-game-friday-winner-prizma-puzzle-challenges#comments</comments>
		<pubDate>Fri, 11 Nov 2011 23:28:53 +0000</pubDate>
		<dc:creator>Colin Cupp</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Flash Game Friday]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Game Showcase]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[Publisher Feed]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[Prizma Puzzle Challenges]]></category>
		<category><![CDATA[Silen Games]]></category>
		<category><![CDATA[winner]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5750</guid>
		<description><![CDATA[Winner&#8217;s Circle This week&#8217;s Flash Game Friday winner is Prizma Puzzle Challenge by Silen Games! Silen Games strikes again with another fantastic installment in the Prizma Puzzle series. It has been a while since we have had a puzzle as our Flash Game Friday winner, and this game definitely fits the bill as a high-quality [...]]]></description>
			<content:encoded><![CDATA[ <h1>Winner&#8217;s Circle</h1>
<p>This week&#8217;s Flash Game Friday winner is<a href="http://www.mochimedia.com/games/play/prizma-puzzle-challenges_v889168/"> Prizma Puzzle Challenge</a> by <a href="http://www.silengames.com/">Silen Games</a>!<br />
<a href="http://www.mochimedia.com/games/play/prizma-puzzle-challenges_v889168/"><img class="alignleft size-full wp-image-5821" style="border: 0px;" title="Prizma Puzzle Challenges" src="http://mochiland.com/wp-content/uploads/2011/11/Prizma-Puzzle-Challenges-560x280.png" alt="" width="560" height="280" /></a><br />
Silen Games strikes again with another fantastic installment in the Prizma Puzzle series.</p>
<p>It has been a while since we have had a puzzle as our Flash Game Friday winner, and this game definitely fits the bill as a high-quality puzzler. There are zones. Within each zone are stages. The goal in each stage is to get to the &#8220;finish&#8221; via a route that nets you the most stars and breaks all the crystals. As you can imagine, the stages get more complicated and challenging as you advance from one level to the next, and from one stage to the next. Silen Games also added achievements to game, giving it an extra layer of interest.</p>
<p>Prizma Puzzle Challenges is a great puzzle game with really nice polish, game mechanics, and achievements that make a great game even better. Congratulations Silen Games!</p>
<h2>Get To Know Silen Games</h2>
<h4>Tell me about yourself-how many people are on your team? Where are you based?</h4>
<p>My name is Vitaliy Sidorov of Silen Games, and I&#8217;m an indie developer. Most of my games were created by me alone, but there are exceptions. Granny Strikes Back is such an exception. This particular game was a collaboration with my friend Ivan Morozov. We are both from Russia, living in remote and cold of Siberia. :)</p>
<h4>How long have you been making games? What did you do before?</h4>
<p>I am actually a lawyer. At first the creation of games was a hobby, but now it&#8217;s my main job. I created my first game 4 years ago, called &#8220;Safe Breaker&#8221;, which I created using the GameMaker engine. I learned Flash a year later and still use it to create games.</p>
<h4>Q: What was your inspiration for &#8220;Prizma Puzzle Challenge&#8221;? How is this one different from your other &#8220;Prizma&#8221; puzzlers?</h4>
<p>Prizma Puzzle was my very first game created with Flash 2.5 years ago. Prizma Puzzle Challenge is the fourth part of the series. When you compare it to the 3rd installment it&#8217;s pretty similar. I added a few new elements, such as Crystals and Crystal Breakers, which serve as doors and keys. I also added a new game mode, Challenges, which consists of light and fun levels that accent only one game element. The game became more simple but not less interesting.</p>
<h4>What types of games do you like to create the most? What types of games do you like to play the most?</h4>
<p>I love to create a shooters that have a lot of explosions, action, drive, and coins:)<br />
I like to experiment with exploration &amp; adventure games. My favorite game from childhood is &#8220;Land Stalker&#8221; for Sega Genesis. I also love the Castlevania series of games, and Metroid.</p>
<h4>How long is your game creation cycle? What is your process?</h4>
<p>I try to finish the game in a month, before it begins to get boring. Any development begins with the selection of the concept and prototype of the basic mechanics of the game. If the gameplay is interesting &#8211; I continue to develop. Next, I create a level editor, and then the schedule. The last thing I do is add levels and sounds, as well as tune the balance of the game.</p>
<h4>Are there any game developers that you admire or consider &#8220;rock stars&#8221;?</h4>
<p>I have great respect for the game designer Jason Kapalka of PopKapa. He creates a brilliant casual games. But I do not always follow his advice. For example, &#8220;Granny and Snowmen&#8221; is a fairly hardcore game and therefore isn&#8217;t as popular among the casual audience. But I think it would be great as a console game.</p>
<h4>What is it about making a new game that you enjoy most?</h4>
<p>I do not like to continue and create sequels. Much more interesting to create something truly new. For example the development of my last game &#8220;The Bee Way&#8221; was a lot of fun.</p>
<h4>Do you have any hot projects you&#8217;re working on right now?</h4>
<p>Now I am finishing work on the game Mushroom Madness 3. Part two was popular and I am sure that part three will be even better!</p>
<p><strong><em>Thanks for answering my questions Vitaliy, and good luck with Mushroom Madness 3!</em></strong></p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; Colin Cupp for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/flash-game-friday-winner-prizma-puzzle-challenges">Permalink</a> |
	  <a href="http://mochiland.com/articles/flash-game-friday-winner-prizma-puzzle-challenges#comments">One comment</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/flash-game-friday-winner-prizma-puzzle-challenges&amp;title=Flash Game Friday Winner: Prizma Puzzle Challenges">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/flash-game-friday-winner-prizma-puzzle-challenges" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/flash-game-friday" title="View all posts in Flash Game Friday" rel="category tag">Flash Game Friday</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland/featured-games" title="View all posts in Game Showcase" rel="category tag">Game Showcase</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>, <a href="http://mochiland.com/category/mochiland/publisher-feed" title="View all posts in Publisher Feed" rel="category tag">Publisher Feed</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/flash-game-friday-winner-prizma-puzzle-challenges/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Game Friday Winner: Bad Eggs Online</title>
		<link>http://mochiland.com/articles/flash-game-friday-winner-bad-eggs-online</link>
		<comments>http://mochiland.com/articles/flash-game-friday-winner-bad-eggs-online#comments</comments>
		<pubDate>Sat, 05 Nov 2011 00:57:31 +0000</pubDate>
		<dc:creator>Colin Cupp</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Flash Game Friday]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Game Showcase]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[Publisher Feed]]></category>
		<category><![CDATA[Bad Eggs Online]]></category>
		<category><![CDATA[bad viking]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[Rob Donkin]]></category>
		<category><![CDATA[winner]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5747</guid>
		<description><![CDATA[Winner&#8217;s Circle This week&#8217;s Flash Game Friday winner is Bad Eggs Online by Rob Donkin! You are an egg. You have weapons. Your job is to take out your enemies, which depending on the type of battle you are in could be the other team or literally every egg on the screen! Bad Eggs Online [...]]]></description>
			<content:encoded><![CDATA[ <h1>Winner&#8217;s Circle</h1>
<p>This week&#8217;s Flash Game Friday winner is <a href="http://www.mochimedia.com/games/play/bad-eggs-online/">Bad Eggs Online</a> by <a href="http://www.robdonkin.com/">Rob Donkin</a>!</p>
<p><a href="http://www.mochimedia.com/games/play/bad-eggs-online/"><img class="alignleft size-full wp-image-5748" style="border: 0px;" title="Bad Eggs Online" src="http://mochiland.com/wp-content/uploads/2011/10/BadEggsOnlineMochi580x520version2.png" alt="" width="580" height="280" /></a></p>
<p>You are an egg. You have weapons. Your job is to take out your enemies, which depending on the type of battle you are in could be the other team or literally every egg on the screen!</p>
<p>Bad Eggs Online is an awesome turn-based multiplayer shooting game that is really innovative because of the integration of some great features such as: in-game chat, achievements, level-ups, skills, custom shells, and even a terrain editor&#8230;whew, talk about a big game!</p>
<p>As you progress through the game, you are awarded new weapons and shell design options (so you can tell who has &#8220;rank&#8221; when you play them). You also acquire achievements, one-time use skills, and there is a store where you can buy things you haven&#8217;t yet earned. There are various combat scenarios for you to choose from, such as 3v3, 2v2, 1v1, or 1v1v1v1v1. As if that weren&#8217;t enough, the in-game chat that carries over from waiting room to the game and back again is a really nice addition. This allows for teams to talk about strategy and even use disinformation tactics!</p>
<p>In Bad Eggs Online, the Donkin brothers did an incredible job at making a deep and social game. The gameplay is smooth, polish is high, and the experience is great. Congratulations Donkins!</p>
<h2>Get To Know Rob Donkin</h2>
<h4>Tell me about yourself- how many people are on your team? Where are you based?</h4>
<p>I&#8217;ve recently started working with my brother and we made Bad Eggs Online together as a two man team with me as coder and him as artist. We both live in the UK.</p>
<h4>How long have you been making games? What did you do before?</h4>
<p>I&#8217;ve been making games for just over 3 years. I dragged John on board earlier this year and since then we&#8217;ve made a few games together. Learning to make games overlapped with uni for me &#8211; I couldn&#8217;t wait to finish my course so I could forget all I&#8217;d learned and start making games full time!</p>
<h4>What was your inspiration for &#8220;Bad Eggs Online&#8221;?</h4>
<p>It&#8217;s pretty clear that Worms provided some inspiration for us but actually we enjoyed playing an artillery game that we knew simply as &#8216;Bomb&#8217; when we were kids. According to wikipedia it was in fact called Tank Wars but was also known as Bomb because that&#8217;s what the file name was. We were also very impressed by another multiplayer tank game called Shellshock Live. We were very conscious of treading in the footsteps of these great games in the same genre that had come before us so we really tried to approach it in our own unique way and come up with features and weaponry that hadn&#8217;t been done before in quite the same way.</p>
<h4>Why multi-player? Why in-game chat? How did you build it?</h4>
<p>I was at FGS earlier this year and sat in on a very inspiring talk by Chris Benjaminsen of Player.IO. His talk was all about how he made Everybody Edits using Player.IO and he included some great figures about how much people were spending in his game. I had been wanting to do a multiplayer game for a while but couldn&#8217;t see how it would work financially (nor did I want to spend ages learning how to go about making one). Player.IO was so well documented and easy to get to grips with (after a bit of a learning curve at the beginning) that I just decided to dive right. I&#8217;d actually prototyped an artillery game with eggs about a year earlier but had dropped it by the wayside.</p>
<p>In-game chat seemed like an obvious thing to include in a multiplayer game. Whilst we were building and testing the game it was clear that the trash talk was a huge part of what made the game fun. What good is smashing your opponent into oblivion if you can&#8217;t laugh in their face afterwards? We didn&#8217;t get chat right first time though. It took a bit of learning as we went to get it where it is now. We initially only had in-game chat so after a game or in the pre-game lobby you couldn&#8217;t chat to each other which was obviously a pretty silly mistake. We also then didn&#8217;t make chat persistent from lobby to game which meant that it was hard to follow a conversation. The great thing about a multiplayer game though is that if you don&#8217;t get it right first time your players will let you know and you can release an update to fix things.</p>
<p><span style="font-weight: bold;">Can you give us any insight into your content release schedule, and how that has impacted the game?</span></p>
<p>Although we don&#8217;t have a rigid schedule that we stick to, we&#8217;re working full time on improving the game, adding new features and additional content on a regular basis. We&#8217;ve worked hard at taking on board the feedback and suggestions from our players, keeping in touch using our forum. So we kind of play it by ear when it comes to new content and such, not to say that we don&#8217;t have stuff waiting in the wings.</p>
<p>We recently launched a cool new feature which we call skills. You can earn one a day and it enables you to cast little perks such as shields or teleport in the game. Sometimes these can be a real game changer and we feel it adds an interesting extra dimension that wasn&#8217;t there previously. At Halloween we added a new map and the zombie egg. We infected one of our players with the zombie and asked them to go forth and spread the outbreak by killing other players with the zombie egg. A week later there are nearly 10,000 infected players.</p>
<p>We also have a huge range of egg shells that people can use to play as in the game. We&#8217;re adding new ones every week with plenty more to come. Did someone say Dragon Eggs?</p>
<h4>Any early trends or stats you can share about player behavior?</h4>
<p>By far and away the most played game type is 1v1 (which is understandable since it is the default selection and also will make for the shortest games). The least played game mode however happens to be my personal favourite: 4 player free for all. I like this game mode because it&#8217;s as much about diplomacy as it is about skill. You have to form alliances if you want to win but you can&#8217;t trust anyone! I&#8217;m also sure that that&#8217;s why it is the least popular game mode&#8230;</p>
<p>Also, it&#8217;s almost worrying how addicted some players get! We don&#8217;t get to track this sort of stuff usually but on a multiplayer game where you have to create an account we can see how individual players progress. When we were making challenges for the game we put some in that we thought would be crazy high for the real addicts like get 500 kills. We&#8217;re already seeing players that have over 1000 kills which is pretty mindblowing and also fantastic to see that people have enjoyed playing so much that they keep coming back for more.</p>
<h4>What types of games do you like to create the most? What types of games do you like to play the most?</h4>
<p>I like making all sorts of games. I like to try and do something a bit different every time but I suppose I do always have the old fall backs of &#8216;something with box2d&#8217; or a point and click adventure. Those are definitely the kinds of games that I like playing so it&#8217;s probably not too surprising that I have made a few of them myself. John and I grew up with classic point and click adventure games such as the Discworld games and Myst series so have always been inspired by those.</p>
<h4>How long is your game creation cycle? What is your process?</h4>
<p>It varies so wildly depending on the game. Bad Eggs has been the longest development time of all my games, partly because it was our most ambitious project so far, partly because I had to learn how to use Player.IO and partly because we&#8217;re still working on it adding new features! Generally we try to aim for about a month per game or less if possible. Bad Eggs has been about 3 months so far I think but after going into beta we let it rest for a week and made a quick little game in between (not yet released though).</p>
<p>We tend to plan our games as thoroughly as possible before we start making anything and use a wiki to keep track of our thoughts. Then it&#8217;s just go go go, referring back to the wiki and filling in the gaps as we go.</p>
<h4>Are there any game developers that you admire or consider &#8220;rock stars&#8221;?</h4>
<p>We admire a lot of developers. Independent game developers in the truest sense of the word who are making amazing games. There are a lot of talented people making flash games and we&#8217;re always impressed by the wealth of entertaining and original ideas that come out on a weekly basis. Some games that have caught our attention recently include Cyclomaniacs 2, The King&#8217;s League, BioGems (and not just because it was made by mochi! This was a really fresh spin on an exhausted genre and we were very impressed by it), Wonderputt, Last Stand: Union City, Shore Siege 2.</p>
<h4>What is it about making a new game that you enjoy most?</h4>
<p>Prototyping a new game is a really fun process. Coming up with the ideas that are going to make a game fun and then being able to very quickly translate that into something you can interact with is something I really love doing.</p>
<h4>Do you have any hot projects you&#8217;re working on right now?</h4>
<p>Bad Eggs Online is still taking up a good chunk of our time at the moment but I do have a sequel to a game I made with the artist RobotJAM in the works (Hambo 2) and we have started brainstorming our next game that may or may not involve a ninja teddy bear.<br />
<strong><em>Congratulations again, looking forward to Hambo 2!</em></strong></p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; Colin Cupp for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/flash-game-friday-winner-bad-eggs-online">Permalink</a> |
	  <a href="http://mochiland.com/articles/flash-game-friday-winner-bad-eggs-online#comments">12 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/flash-game-friday-winner-bad-eggs-online&amp;title=Flash Game Friday Winner: Bad Eggs Online">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/flash-game-friday-winner-bad-eggs-online" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/flash-game-friday" title="View all posts in Flash Game Friday" rel="category tag">Flash Game Friday</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland/featured-games" title="View all posts in Game Showcase" rel="category tag">Game Showcase</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>, <a href="http://mochiland.com/category/mochiland/publisher-feed" title="View all posts in Publisher Feed" rel="category tag">Publisher Feed</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/flash-game-friday-winner-bad-eggs-online/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Building A Retro Platform Game In Flixel, Pt. 1</title>
		<link>http://mochiland.com/articles/building-a-retro-platform-game-in-flixel-pt-1</link>
		<comments>http://mochiland.com/articles/building-a-retro-platform-game-in-flixel-pt-1#comments</comments>
		<pubDate>Thu, 03 Nov 2011 20:26:24 +0000</pubDate>
		<dc:creator>Photon Storm</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Developer Spotlight]]></category>
		<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Flixel]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[Photon Storm]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5618</guid>
		<description><![CDATA[Building a retro platform game in Flixel, Part 1 Note: This tutorial was originally written for .net magazine. I&#8217;m now allowed to publish it here, so read on and enjoy! Grab the files for download before starting! Retro style games are becoming more popular than ever online. Commonly referred to as &#8220;8-bit&#8221; these games have [...]]]></description>
			<content:encoded><![CDATA[ <p><strong>Building a retro platform game in Flixel, Part 1</strong></p>
<p>Note: This tutorial was <a title="My .net magazine " href="http://www.photonstorm.com/archives/1436/my-net-magazine-build-a-retro-game-in-flixel-article-is-now-out">originally written</a> for .net magazine. I&#8217;m now allowed to publish it here, so read on and enjoy! Grab the files for <a href="http://www.photonstorm.com/archives/2247/flash-game-dev-tip-12-building-a-retro-platform-game-in-flixel-part-1">download</a> before starting!</p>
<p>Retro style games are becoming more popular than ever online. Commonly referred to as &#8220;8-bit&#8221; these games have pixel-art graphics and &#8220;chip tune&#8221; music that apes the consoles of old, but often have surprisingly innovative gameplay mechanics. And Flash has turned out to be the perfect tool for creating them, as hit titles like <a href="http://adamatomic.com/canabalt/">Canabalt</a> and <a href="http://adamatomic.com/fathom" target="_blank">Fathom</a> demonstrate.</p>
<div id="attachment_2248" class="wp-caption alignnone" style="width: 417px"><img src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Fathom.png" alt="" /><p class="wp-caption-text">Fathom was one of the first games built with Flixel and is a good example of what it can do.</p></div>
<p>This may seem at odds with a technology known for its vector graphics and timeline animation. But under the hood Flash is perfectly capable of pushing around large volumes of pixels which is exactly what is required. Flixel is a game framework born from a desire to create 8-bit style games. But it has evolved into a powerful way to rapidly create games in Flash. With a strong community and plug-ins available it&#8217;s the perfect choice to create our game with. In this two part series we&#8217;ll explore how Flixel works and build a retro-styled platform game in the process.</p>
<p><a href="http://sandbox.photonstorm.com/netmag/Building%20a%20retro%20Flash%20game%20in%20Flixel%20Part%201.zip">Download the tutorial files</a> and look through the source code alongside reading the article, because for the sake of space not all of it can be included here and we&#8217;ve got a lot of ground to cover.</p>
<h2>Getting started</h2>
<p>For Windows users there is a guide on <a href="http://www.photonstorm.com/archives/1200/flash-game-dev-tip-6-setting-up-flashdevelop-and-flixel-for-the-first-time" target="_blank">installing FlashDevelop with Flixel</a>. On Mac OS X you can use Adobe Flash Builder. <a href="http://flashgamedojo.com/wiki/index.php?title=Hello_World_-_Flash_Builder_(Flixel)" target="_blank">FlashGameDojo has a tutorial</a> for this. Or run <a href="http://www.flashdevelop.org/community/viewtopic.php?f=9&amp;t=2463" target="_blank">FlashDevelop under Parallels</a>.</p>
<p>Even if you use FlashDevelop / Flash Builder already I&#8217;d still recommend following the guides so you become familiar with the Flixel package structure.</p>
<h2>Game Design Brief</h2>
<p>It helps to have a plan of your game <em>before</em> you start on it. While the plan should never restrict you from iterating your game during development, it will set a base ground on which to build. Here is a concise brief for our game:</p>
<p>&#8220;Player controls a chick who can run left/right and jump on platforms across a horizontally scrolling level. The environment is a lush green jungle with trees, grass, flowers and ruins to explore. There will be static and moving platforms and stars to collect. Collect enough stars and the level exit opens. Player cannot die by falling unless he hits the water. Animal baddies move around the platforms and are fatal to touch.&#8221;</p>
<p>From this brief we can instantly visualise how the game will look and play. This allows us to break the code structure into logical objects such as Player, Map, Star and Enemy. The artist can also create concept sketches to set the style of the game, and provide a point of reference for the pixel art.</p>
<div id="attachment_2249" class="wp-caption alignnone" style="width: 443px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Nutmeg-Concept-Sketches-433x480.jpg"><img class="size-medium wp-image-2249" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Nutmeg-Concept-Sketches-433x480.jpg" alt="" width="433" height="480" /></a><p class="wp-caption-text">Concept Sketches These help set a visual style for the game, introduce main characters and act as a reference for the pixel art.</p></div>
<h2>It starts with FlxGame</h2>
<p>Open <em>Main.as</em> from the &#8220;Part 1&#8243; source folder:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> Main <span style="color: #0033ff; font-weight: bold;">extends</span> FlxGame
<span style="color: #000000;">&#123;</span>
<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">320</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">240</span><span style="color: #000066; font-weight: bold;">,</span> PlayState<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">60</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">60</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
forceDebugger = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>FlxGame is the wrapper for your whole game, setting up Flixel in the process. The call to <em>super</em> sets the resolution of our game (320 x 240), the initial State (PlayState), the zoom level (2) and the frame rates (60 fps).</p>
<p>While 320 x 240 may seem small at a zoom level of 2 it will display at 640 x 480. The up-scaling of retro games is a common trait that helps show-off the detailed pixel art. <em>forceDebugger</em> enables the built-in debugger which is activated by pressing the &#8216; key. This lets you view bounding boxes, collision, paths, variables, logs and save out game replays.</p>
<p>Your game can have only one FlxGame class, but it can have many State<em>s</em>. States are a way to split your game into logical sections. For example a <em>MainMenuState</em>, a <em>PlayState</em> with the guts of the game and a <em>GameOverState</em>. Only one State can be active at a time.</p>
<h2>Getting into a right State</h2>
<p>States in Flixel extend FlxState and they are the guts of your game. When the State is initialised it calls the function <em>create</em>. This is used to construct any assets or variables the game needs. Once your game is running Flixel calls the <em>update</em> function every frame. In Flash terms it&#8217;s the equivalent of an Enter Frame event. Here is where you handle anything that needs to happen continuously. We&#8217;ll use it to detect collision between game objects.</p>
<p>Inside the <em>create</em> function we make two types of object: the Player sprite and some platforms.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">player = <span style="color: #0033ff; font-weight: bold;">new</span> Player<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">32</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">floor</span> = <span style="color: #0033ff; font-weight: bold;">new</span> FlxTileblock<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">208</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">320</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">32</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">floor</span><span style="color: #000066; font-weight: bold;">.</span>makeGraphic<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">320</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">32</span><span style="color: #000066; font-weight: bold;">,</span> 0xff689c16<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span>player<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">floor</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>The <em>floor</em> variable is one such platform. Although we&#8217;ll replace it in the final game it&#8217;s a great rapid way to provide objects the player can jump on to test the physics. The objects are then added to the State, allowing Flixel to draw them when it renders the scene. It&#8217;s similar to <em>addChild</em> in native Flash and the order in which you add defines how they are drawn.</p>
<p>All player specific code is held in the Player class, represented here through the <em>player</em> variable. This keeps it organised and easy to re-use. Before we start that however we need to give our player some wings &#8211; quite literally &#8211; by preparing the sprite sheet.</p>
<div id="attachment_2250" class="wp-caption alignnone" style="width: 650px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Player-Sprite-Sheet-640x182.png"><img class="size-medium wp-image-2250" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Player-Sprite-Sheet-640x182.png" alt="" width="640" height="182" /></a><p class="wp-caption-text">Nutmeg The sprite sheet for the pixel hero of our game, drawn in 16 x 18 sized frames.</p></div>
<p>Flixel can automatically create reversed frames so we only draw him facing right. The first frame is an idle pose. Frames 2 and 3 are the walk cycle, and frame 4 is a hurt expression. If you are more comfortable animating inside of Flash Professional then you can create a timeline sequence as usual, export it to a SWF and use a tool such as Grant Skinner&#8217;s Zoe (<a href="http://easeljs.com/zoe.html">http://easeljs.com/zoe.html</a>) to convert it to a sprite sheet.</p>
<p>Sprites in Flixel are called FlxSprite which is what our Player extends. These differ from regular Flash Sprites in that as well as graphics data they contain extra values to allow you to easily control physics, animation, direction, collision and rotation. Inside Player.as we&#8217;ve embedded the sprite sheet:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000000;">&#91;</span>Embed<span style="color: #000000;">&#40;</span><span style="color: #004993;">source</span> = <span style="color: #990000;">'../assets/player.png'</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span> <span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> playerPNG<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Class</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>And then tell FlxSprite to use it:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">loadGraphic<span style="color: #000000;">&#40;</span>playerPNG<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">16</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">18</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>This tells Flixel  to chop the sheet into 16&#215;18 frames and create reversed versions. Animation works in a similar way to Flash MovieClips.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">addAnimation<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;walk&quot;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>This creates a new animation sequence called &#8220;walk&#8221; which cycles through frames 0, 1, 0, 2 at a rate of 10 frames per second. The true parameter makes it loop. To play an animation you use its label:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">play</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;walk&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<h2>What goes up must come down</h2>
<p>Making the player sprite run and jump smoothly provides us with a great opportunity to explore ones of Flixel&#8217;s strengths: its plug-ins. Much like with WordPress and Drupal, the Flixel community release plug-ins which extend the framework further and ultimately save you time.</p>
<p>One such plug-in is FlxControl which is part of the Flixel Power Tools. They are included in the tutorial zips but are constantly updated, so check <a href="https://github.com/photonstorm/Flixel-Power-Tools" target="_blank">https://github.com/photonstorm/Flixel-Power-Tools</a> for updates. If downloading fresh there is a Getting Started guide in the Docs folder.</p>
<p>The plug-in needs to be activated and assigned to our player FlxSprite:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>FlxG<span style="color: #000066; font-weight: bold;">.</span>getPlugin<span style="color: #000000;">&#40;</span>FlxControl<span style="color: #000000;">&#41;</span> == <span style="color: #0033ff; font-weight: bold;">null</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
FlxG<span style="color: #000066; font-weight: bold;">.</span>addPlugin<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> FlxControl<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span>
FlxControl<span style="color: #000066; font-weight: bold;">.</span>create<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">,</span> FlxControlHandler<span style="color: #000066; font-weight: bold;">.</span>MOVEMENT_ACCELERATES<span style="color: #000066; font-weight: bold;">,</span> FlxControlHandler<span style="color: #000066; font-weight: bold;">.</span>STOPPING_DECELERATES<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>The parameters tell it that we want the sprite to accelerate and decelerate. If we didn&#8217;t pick this the sprite would start and stop immediately making the experience very abrupt.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">FlxControl<span style="color: #000066; font-weight: bold;">.</span>player1<span style="color: #000066; font-weight: bold;">.</span>setCursorControl<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
FlxControl<span style="color: #000066; font-weight: bold;">.</span>player1<span style="color: #000066; font-weight: bold;">.</span>setJumpButton<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;SPACE&quot;</span><span style="color: #000066; font-weight: bold;">,</span> FlxControlHandler<span style="color: #000066; font-weight: bold;">.</span>KEYMODE_PRESSED<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">200</span><span style="color: #000066; font-weight: bold;">,</span> FlxObject<span style="color: #000066; font-weight: bold;">.</span>FLOOR<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">250</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">200</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
FlxControl<span style="color: #000066; font-weight: bold;">.</span>player1<span style="color: #000066; font-weight: bold;">.</span>setMovementSpeed<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">400</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">200</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">400</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
FlxControl<span style="color: #000066; font-weight: bold;">.</span>player1<span style="color: #000066; font-weight: bold;">.</span>setGravity<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">400</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>This enables cursor control for the left and right keys, and sets SPACE BAR to be the jump button. The player can only jump if on the floor and will try to jump to a height of 200 pixels. setMovementSpeed allows the sprite to accelerate at 400px/sec up to top speed of 100px/sec. Modify these values to much lower or higher numbers to see the effect! Finally we set some gravity, pulling the player back down to earth. Try changing the gravity value to make the player float or drop like a lead balloon. The best thing you can do to learn about Flixel and its plug-ins is to mess around with them. You never know what might come out of it! I&#8217;ve seen whole game ideas born from what were code bugs, so it pays to experiment.</p>
<h2>Putting it all together</h2>
<p>Run the code at this point and you&#8217;ll see we have a cute little chick sprite who can run and leap around at will. It collides smoothly with the ground, and there&#8217;s even a platform to leap on. If you press the debug key (&#8216;) you can watch the physics values in real-time. Click the box icon in the top right to turn on the visual outlines.</p>
<div id="attachment_2251" class="wp-caption alignnone" style="width: 650px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Test-1.png"><img class="size-full wp-image-2251" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Test-1.png" alt="" width="640" height="480" /></a><p class="wp-caption-text">We have lift off! A running and jumping player with platforms to leap on</p></div>
<p>Granted it isn&#8217;t quite Mario, but we&#8217;re not finished just yet.</p>
<h2>Building a Level Map with DAME</h2>
<p>Green blocks are all well and good, but we need a proper level for the player to explore. Flixel has built-in support for Tile Maps which are an efficient and fast way to construct game levels. Tile Maps work by using Tile Set in a series of tiles aligned to a fixed-size grid. Here is the Tile Set created for our game:</p>
<div id="attachment_2252" class="wp-caption alignnone" style="width: 650px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Tileset-640x202.png"><img class="size-medium wp-image-2252" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Tileset-640x202.png" alt="" width="640" height="202" /></a><p class="wp-caption-text">The Tile Set used to draw the game map, complete with water, plants and platforms.</p></div>
<p>Each tile is 16&#215;16 pixels in size, and you can see that some of them join together to form game objects such as the platform in the bottom right. The organisation of the Tile Set is up to you (or your artist!), but it&#8217;s sensible to leave big chunks of empty tiles should you need to insert new tiles later on in development. Tiles are separated into two types: Tiles you can collide with, and tiles you never collide with. In Flixel this is determined by the tile number and is called the Collide Index. Every tile after the index is treated as a tile you collide with. In our Tile Set you&#8217;ll see on the top row items such as flowers, bushes and shrubs. These are all non-colliding tiles, as we don&#8217;t want our player getting stuck on flowers.</p>
<p>With our Tile Set created we now need to design the level. To do this we use a Tile Map Editor. For this tutorial we&#8217;ll use an editor called DAME. Although the interface takes some getting used-to, the actual map view in DAME is rendered directly with Flixel so you know for sure that what you see in the editor is how it appears in game.</p>
<p>DAME can be downloaded from <a href="http://dambots.com/dame-editor/" target="_blank">http://dambots.com/dame-editor/</a> and works on Windows, OS X and Linux. Create 3 map layers in DAME, one for the Sky background, one for the level itself and one for the stars which the player can collect. You can find our DAME maps by downloading the tutorial files and looking in &#8220;Nutmeg Part 2 &#8211; The Map&#8221;. With the Map Layer selected click on a tile in the Tile window and then paint with it, just like an art package:</p>
<div id="attachment_2253" class="wp-caption alignnone" style="width: 650px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Map-Editing-with-Dame-640x360.png"><img class="size-medium wp-image-2253" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Map-Editing-with-Dame-640x360.png" alt="" width="640" height="360" /></a><p class="wp-caption-text">Tile Map Editor DAME in action showing part of the level created for the game</p></div>
<p>Once you are happy with the design of your level you can export the map data to a CSV file from the File ñ Export menu.</p>
<h2>Lights, Camera, Action</h2>
<p>Add a new class to the project called Level1 that extends FlxGroup. This is Flixel&#8217;s way of grouping display objects together and keeps our code logical and structured. We can also check for collision against a whole group, which is significantly faster than checking every element individually. Our map is held in a local variable:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #004993;">map</span> = <span style="color: #0033ff; font-weight: bold;">new</span> FlxTilemap<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">map</span><span style="color: #000066; font-weight: bold;">.</span>loadMap<span style="color: #000000;">&#40;</span><span style="color: #0033ff; font-weight: bold;">new</span> mapCSV<span style="color: #000066; font-weight: bold;">,</span> mapTilesPNG<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">16</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">16</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">31</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #004993;">add</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">map</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>loadMap takes our CSV map data exported from DAME, and an embedded Tile Set png and creates a Tile Map object which is then added to the group. The same process is repeated for the Sky background.</p>
<p>Back in the PlayState we add the level to the display. But before we can unleash the player we tell Flixelís camera system to follow them around and restrict the camera to the map boundary:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">FlxG<span style="color: #000066; font-weight: bold;">.</span>camera<span style="color: #000066; font-weight: bold;">.</span>setBounds<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">level</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">level</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">height</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
FlxG<span style="color: #000066; font-weight: bold;">.</span>camera<span style="color: #000066; font-weight: bold;">.</span>follow<span style="color: #000000;">&#40;</span>player<span style="color: #000066; font-weight: bold;">,</span> FlxCamera<span style="color: #000066; font-weight: bold;">.</span>STYLE_PLATFORMER<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>The last task is to add a collision check into the PlayState update function:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">FlxG<span style="color: #000066; font-weight: bold;">.</span>collide<span style="color: #000000;">&#40;</span>player<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">level</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>With the map loaded, the camera set and collision running we can now test the game. The chick now happily bounces around the level, landing on platforms and not colliding with flowers.</p>
<h2>Sprinkling a little stardust</h2>
<p>Now we&#8217;ve a pretty landscape to traverse we&#8217;ll add stars for the player to collect, and display the total collected as a score in the game. Flixel has a text function called FlxText which we use to display the score:</p>
<p>&gt;</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">score = <span style="color: #0033ff; font-weight: bold;">new</span> FlxText<span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #000000; font-weight:bold;">100</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
score<span style="color: #000066; font-weight: bold;">.</span>scrollFactor<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">x</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span>
score<span style="color: #000066; font-weight: bold;">.</span>scrollFactor<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">y</span> = <span style="color: #000000; font-weight:bold;">0</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>The score is added at the top left of the screen and has a scrollFactor of zero. This means the text will be locked in place at the coordinates given, and not scroll around as the camera moves.</p>
<p>In the DAME map the Stars layer was exported to a CSV file and weíll use this map data to create Star sprites. The function parseStars in the Level1 class works by looping through the CSV map data, and for every tile it creates a new Star sprite at those coordinates. All of these sprites are added to an FlxGroup called stars. In the PlayState update function we check to see if the player is colliding with a star:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">FlxG<span style="color: #000066; font-weight: bold;">.</span>overlap<span style="color: #000000;">&#40;</span>player<span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">level</span><span style="color: #000066; font-weight: bold;">.</span>stars<span style="color: #000066; font-weight: bold;">,</span> hitStar<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>If a collision occurs this will call the function hitStar, passing in the two objects that collided, in this case the player and the star he hit. The star is removed from the game and the score increased:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">star<span style="color: #000066; font-weight: bold;">.</span>kill<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
FlxG<span style="color: #000066; font-weight: bold;">.</span>score <span style="color: #000066; font-weight: bold;">+</span>= <span style="color: #000000; font-weight:bold;">1</span><span style="color: #000066; font-weight: bold;">;</span>
score<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">text</span> = FlxG<span style="color: #000066; font-weight: bold;">.</span>score<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #990000;">&quot; / &quot;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #004993;">level</span><span style="color: #000066; font-weight: bold;">.</span>totalStars<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">toString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span></pre></div></div>

<p>Finally the score text is updated to show them how many stars they&#8217;ve collected, and how many are left. With this one small addition we&#8217;ve now got a real playable game with an objective to collect all stars:</p>
<div id="attachment_2254" class="wp-caption alignnone" style="width: 650px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/nutmeg_preview1.png"><img class="size-full wp-image-2254" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/nutmeg_preview1.png" alt="" width="640" height="480" /></a><p class="wp-caption-text">Reach for the stars With the stars in place our game now has a purpose - try to complete the level</p></div>
<p>In part 2 we will introduce baddies for you to avoid, sound effects, a user interface (HUD) and Game Over sequence. If you feel inspired to build your own games be sure to visit <a href="http://flixel.org" target="_blank">http://flixel.org</a> which is home to a vibrant developer community. You&#8217;ll also find stacks of Flixel related tutorials at <a href="http://www.photonstorm.com" target="_blank">http://www.photonstorm.com</a> along with the Flixel Power Tools plug-ins. Finally for reference to the classic games of old <a href="http://www.retrogamingtimes.com" target="_blank">http://www.retrogamingtimes.com</a> is well worth a visit.</p>
<p>The following 2 parts were the &#8220;box-outs&#8221; that appeared in the print article. I&#8217;ve included them here because they&#8217;re interesting :)</p>
<h2>Adam Saltsman talks about why he created Flixel</h2>
<p>I guess it was around 7 years ago that I tried to make a little &#8220;game engine&#8221;, something that would allow me to make Super NES style games. It just seemed like a fun thing to do. After a few abortive attempts in C++ / Python / Java I finally settled on AS3. It was the pixel-level stuff in it that really interested me. However I&#8217;d grown very cautious about &#8220;engine building&#8221; and not actually making any games. So I stuck with AS3 and created game after game, and noticed which patterns evolved. The games kept getting more complex, and re-used code from previous projects, and eventually those parts I was seeing in every project got moved to their own folder. I think a lot (if not most) developers have a similar folder somewhere, just a pile of &#8220;really handy&#8221; code.</p>
<p>Originally this was just for me, something I&#8217;d use to sketch new game designs in. But it wasn&#8217;t long before I thought that with a little polish here and there I might be able to release it publicly. Turns out it needed a lot of polish (and still does), but I really like where it&#8217;s going. Lately I have been thinking a lot about how to &#8220;make stuff that matters&#8221;, which is a very loose idea, but something I obsess over, for better or worse. I think Flixel is a cool thing. It&#8217;s not really &#8220;art&#8221; in and of itself, but it contributes to the cultural food chain, and that makes me feel like a hero.</p>
<p>Eventually it would be great to add official support for a physics engine like Nape, and port it over to Molehill, the hardware-accelerated Flash Player by the end of the year. I am very hesitant to ever add game-specific features to the framework, but these all seem like good general systems and will just make making games easier and more fun.</p>
<p>At the risk of leaving out something awesome I would say the following games are shining examples of Flixel in action:</p>
<p><a href="http://adamatomic.com/canabalt/" target="_blank">Canabalt</a><br />
<a href="http://patkemp.com/wp-gallery/games/Station38.html" target="_blank">Station 38</a><br />
<a href="http://www.newgrounds.com/portal/view/522276" target="_blank">Tuper Tario Tros</a><br />
<a href="http://www.newgrounds.com/portal/view/555641" target="_blank">Cat Astro Phi</a></p>
<div id="attachment_2255" class="wp-caption alignnone" style="width: 539px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Box-Out-1-Cat-Astro-Phi-529x480.png"><img class="size-medium wp-image-2255" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Image-Box-Out-1-Cat-Astro-Phi-529x480.png" alt="" width="529" height="480" /></a><p class="wp-caption-text">Cat Astro Phi Designed to look, sound and feel like a Gameboy Classic title it&#39;s a good example of what Flixel is capable of.</p></div>
<h2>Pushing Pixels</h2>
<h3>Mastering the style of pixel art</h3>
<p>Professional pixel artist Ilija Melentijevic explains how he created the artwork for Nutmeg:</p>
<p>Pixel art is a time-consuming but rewarding approach to creating game graphics. If you have little screen space such as on a mobile device, or are simply looking for that charm and precision it offers, then itís worth making the extra effort. Also, it&#8217;s incredibly fun!</p>
<p>It&#8217;s a good idea to start from the big picture. First make a mock-up of a game scene, defining the style, colours, characters, etc. Once you have such solid foundation it&#8217;s easy to turn it into actual game assets. Your art must fit and enhance the game, not just look nice on its own, so make sure everything reads well and speaks to the player in a consistent way. In a busy shooter, use colours to separate bullets from power-ups, or to make the foreground objects pop out. Immersion is a priority in any game, and understanding what&#8217;s going on plays a big part in this. Fire up your favourite games and look how the pros do it.</p>
<p>There are a number of tools you can use and they vary widely. Some people even use Microsoft Paint! Many professionals use Photoshop and it certainly gets the job done, but I prefer a dedicated pixel-oriented program. Closest to the industry standard is <a href="http://cosmigo.com" target="_blank">Cosmigo Promotion</a> which boasts an impressive set of features and will look familiar to Photoshop users. My personal favourite is the 100% free <a href="http://code.google.com/p/grafx2" target="_blank">GraFX2</a>. Currently it lacks animation, but otherwise provides for an unparalleled workflow and ease of use.</p>
<p>Make sure you join an active pixel art community that will provide both feedback and motivation. <a href="http://www.pixeljoint.com" target="_blank">PixelJoint</a> lets you comment, rate and vote on other people&#8217;s work, submit your own, and even take part in weekly challenges, perhaps the best way to hone your skills.</p>
<p>For a less casual approach consider <a href="http://pixelation.wayofthepixel.net" target="_blank">Pixelation</a>, a community focused on pushing the medium forward. Here you&#8217;ll find discussions on theory, game art analysis, collaborations and more. Many masters of the form frequent the forum, so it&#8217;s a great place to post your work to get some constructive critique.</p>
<p>View Ilija&#8217;s artwork at <a href="http://www.photonstorm.com/topics/art" target="_blank">http://www.photonstorm.com/topics/art</a></p>
<div id="attachment_2256" class="wp-caption alignnone" style="width: 650px"><a href="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Box-Out-2-Grafx2-640x457.png"><img class="size-medium wp-image-2256" style="border: 0px;" src="http://c251763.r63.cf3.rackcdn.com/wp-content/uploads/2011/09/Box-Out-2-Grafx2-640x457.png" alt="" width="640" height="457" /></a><p class="wp-caption-text">GraFX2 A lightweight and free (as in free beer) pixel-pushing program for Windows, Mac and Linux</p></div>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; Photon Storm for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/building-a-retro-platform-game-in-flixel-pt-1">Permalink</a> |
	  <a href="http://mochiland.com/articles/building-a-retro-platform-game-in-flixel-pt-1#comments">7 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/building-a-retro-platform-game-in-flixel-pt-1&amp;title=Building A Retro Platform Game In Flixel, Pt. 1">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/building-a-retro-platform-game-in-flixel-pt-1" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/developer-spotlight" title="View all posts in Developer Spotlight" rel="category tag">Developer Spotlight</a>, <a href="http://mochiland.com/category/mochiland/flash" title="View all posts in Flash Development" rel="category tag">Flash Development</a>, <a href="http://mochiland.com/category/mochiland/front-page" title="View all posts in Front Page" rel="category tag">Front Page</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>, <a href="http://mochiland.com/category/mochiland/tutorials" title="View all posts in Tutorials" rel="category tag">Tutorials</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/building-a-retro-platform-game-in-flixel-pt-1/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How To Put A New Spin On An Old Genre</title>
		<link>http://mochiland.com/articles/how-to-put-a-new-spin-on-an-old-genre</link>
		<comments>http://mochiland.com/articles/how-to-put-a-new-spin-on-an-old-genre#comments</comments>
		<pubDate>Tue, 04 Oct 2011 00:31:24 +0000</pubDate>
		<dc:creator>freelanceflashgames</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[freelanceflashgames]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Mochi Media]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5552</guid>
		<description><![CDATA[Coming up with an idea for a flash game is tough work, but it&#8217;s even tougher to come up with an idea that hasn&#8217;t been done before. So many games have been released, that it seems like everything has been done. But sometimes all it takes is a little tweaking on an old idea to [...]]]></description>
			<content:encoded><![CDATA[ <p>Coming up with an idea for a flash game is tough work, but it&#8217;s even tougher to come up with an <a href="http://freelanceflashgames.com/news/game-ideas/">idea</a> that hasn&#8217;t been done before.</p>
<p>So many games have been released, that it seems like everything has been done. But sometimes all it takes is a little tweaking on an old idea to create a new one.</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/09/SpinningTops.png"><img class="aligncenter size-full wp-image-5554" style="border: 0px;" title="SpinningTops" src="http://mochiland.com/wp-content/uploads/2011/09/SpinningTops.png" alt="" width="636" height="360" /></a></p>
<p><strong>Problem:</strong> There are thousands of Flash games out there on the web and it&#8217;s tough to make your game stand out from the rest.</p>
<p><strong>Solution:</strong> Make your game unique.</p>
<p>Before I get into the meat of this post, I&#8217;d like to say I&#8217;m glad to be writing again. The last few months of summer were spent researching in the environmental science field. Flash was put aside as I immersed myself into something new. But I&#8217;ve been drawn back into the Flash community temporarily, and expect to pop up again from time to time. Without further introduction, let&#8217;s get into a few ways to put a new spin on an old genre.</p>
<h3>1. Reverse Roles</h3>
<p>If you&#8217;re looking for an easy way to make your game unique, try putting the player into a new, unconventional role.</p>
<p>In my game <a href="http://freelanceflashgames.com/news/games/whack-a-mole-revenge/">Whack A Mole: Revenge</a>, I had gamers playing as the moles, trying to avoid the computer&#8217;s incoming hammers. It was a simple idea, but it made my game stand out. You could apply this concept to nearly any genre. In a tower defense game, have the player send waves of enemies instead of defending with towers. In an adventure game, have the player build a map that will stop the adventurer.</p>
<p>Here are some common role reversal ideas:</p>
<ul>
<li>Side-kick/Hero</li>
<li>Player/Enemy</li>
<li>Good/Evil</li>
<li>Follower/Leader</li>
<li>Player/Level Builder</li>
</ul>
<p>Those are just a few ideas to get you started. Be creative with it!</p>
<h3>2. Mix Genres</h3>
<p>As high school chemistry teaches us, a great way to make something new is to mix two different things together.</p>
<p>The same concept can be applied to your game development. Mix up the objectives of one genre with the gameplay elements of another. Or perhaps mix the time period of one genre with the time period of another.</p>
<h3>3. Introduce a New Game Element</h3>
<p>While our the first two suggestions can completely change the way a game is played, this third suggestion merely adds upon the genre. Think of it like the toppings on your ice cream. You don&#8217;t need them to enjoy the ice cream, but they can make it better.</p>
<p>A new gameplay element could be anything from a simple mini-game (a fighting mode in a football game, i.e. Blitz) to a complex chat system which allows you to control your squadmates in a shooting/strategy game.</p>
<h3>4. When in Doubt, Add Features</h3>
<p>If you went through all these tips and still can&#8217;t think of any new game ideas you&#8217;re excited about, don&#8217;t fret just yet. Perhaps there are some features you can add to make your game more unique than the rest.</p>
<p>For example, most pong games are too simple to have an upgrades store. Maybe you could add upgrades and achievements into your pong game to make it something new and interesting. Or maybe you want to make a shooting game. How about adding a custom gun creator, complete with design elements, shot type, damage and more?</p>
<h3>Wrapping it up</h3>
<p>There are many ways to take an old genre&#8217;s gameplay and turn it into a game that is new and interesting. It takes creativity though, so don&#8217;t be afraid to think outside the box. Get messy if you have to. Just don&#8217;t forget to get feedback before you start developing. Sometimes what&#8217;s awesome to you might be completely wacky to others.</p>
<p>When have you developed a game that was unique and different? <strong>Tell us about it in the comments.</strong></p>
<p>Photo Credit: <a href="http://www.flickr.com/photos/marcygallery/2933445522/">thephotographymuse</a></p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; freelanceflashgames for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/how-to-put-a-new-spin-on-an-old-genre">Permalink</a> |
	  <a href="http://mochiland.com/articles/how-to-put-a-new-spin-on-an-old-genre#comments">12 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/how-to-put-a-new-spin-on-an-old-genre&amp;title=How To Put A New Spin On An Old Genre">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/how-to-put-a-new-spin-on-an-old-genre" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/front-page" title="View all posts in Front Page" rel="category tag">Front Page</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/how-to-put-a-new-spin-on-an-old-genre/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Recap: Mochi London 2011</title>
		<link>http://mochiland.com/articles/recap-mochi-london-2011</link>
		<comments>http://mochiland.com/articles/recap-mochi-london-2011#comments</comments>
		<pubDate>Mon, 19 Sep 2011 20:43:17 +0000</pubDate>
		<dc:creator>ChrisJeff</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Games Industry]]></category>
		<category><![CDATA[Mochi Media Announcements]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[Publisher Feed]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Mochi London]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[publisher]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5499</guid>
		<description><![CDATA[&#160; What Is Mochi London? Mochi London has been held for 3 consecutive years now as a community-driven Flash game developer meetup averaging 8-12 attendees, and has traditionally resulted in open conversations with regards to Flash game development. Ernesto Quezada and myself have been to every single one, with Ernesto serving as the organizer the [...]]]></description>
			<content:encoded><![CDATA[ <h1 style="text-align: left;"><a href="http://chris-jeff.com/wp-content/uploads/2011/07/mochilondon-logo_big.png"><img class="size-full wp-image-597 aligncenter" style="border: 0px;" title="mochilondon-logo_big" src="http://chris-jeff.com/wp-content/uploads/2011/07/mochilondon-logo_big.png" alt="mochilondon-logo_big" width="185" height="225" /></a></h1>
<p>&nbsp;</p>
<h1><span class="summary">What Is Mochi London?</span></h1>
<p>Mochi London has been held for 3 consecutive years now as a community-driven Flash game developer meetup averaging 8-12 attendees, and has traditionally resulted in open conversations with regards to Flash game development. Ernesto Quezada and myself have been to every single one, with Ernesto serving as the organizer the past two years. Well things changed in 2011 after Ernesto and I had a little conversation- we wanted this year to be bigger and better than before!</p>
<h2>Who Are We?</h2>
<p>I&#8217;ll start off with myself! My name is Chris Jeffrey, I&#8217;m a Games Developer based in the United Kingdom. I primarily develop on the Flash platform, however as of late I&#8217;ve also started porting games over to iOS &amp; Android platforms as well. I&#8217;ve been using Flash for around 5 years in total and developed games casually for approximately 3 of those years.</p>
<p>However! More recently I&#8217;ve actually made a bold move and actually left my job to go full-time indie, so I&#8217;m really looking forward to having the chance to devote all of my time to development. Apparently the content I throw out can be somewhat successful, ranging from 4-8m impressions in their life cycle, but if you want to know more and hear me blabber on, head over to <a href="http://www.chris-jeff.com" target="_blank">chris-jeff.com</a>, where I dribble in the form of blog posts! You can also find me on <a href="http://www.twitter.com/chrisjeffgames" target="_blank">Twitter</a>.</p>
<p>Ernesto Quezada is a Games Developer/Publisher from El Salvador. He started using Flash in version 4 back in the late 90&#8242;s. In 2002 he moved to London. After learning a bit of English, in 2005 he went on to get his Masters degree in Digital Media at the London Metropolitan University. Even though he&#8217;s been working professionally as a Flash developer since 2006, his graphic design background still stops him from moving completely to the dark side so he&#8217;s still a bit scared of the command line which, anyway, he uses at work on a daily basis. He&#8217;s created about 30 games in the past 10 years (and has drank a lot of tequila on the way&#8230;). Check out his portal over at <a href="http://games-garden.com" target="_blank">games-garden.com</a>.</p>
<div id="attachment_606" class="wp-caption alignleft" style="width: 590px"><a href="http://chris-jeff.com/wp-content/uploads/2011/09/pict0032.jpg"><img class="size-full wp-image-606         " style="border: 0px;" title="Mochi London 2008" src="http://chris-jeff.com/wp-content/uploads/2011/09/pict0032.jpg" alt="First meet up in 2008" width="580" height="436" /></a><p class="wp-caption-text">First meet up in 2008</p></div>
<h2>Why London?</h2>
<p>Exactly! It&#8217;s what I ask myself. Personally, Mochi Newcastle seemed much more appealing (I live in Newcastle). Honestly though London is a great place and we thought it would be a more convenient location for the majority of people, plus it has the added tourist incentive for people to see the sights and such. Previous Mochi London meetups have generally been with developers in and around the London area, so we didn&#8217;t feel a need for our 4th event to be anywhere else!</p>
<h2>The Venue</h2>
<p>Ernesto, the London local (and official Mochi London tour guide) received a really good tip on this one. After he checked it out and shared pictures of it with the rest of us, we knew right away that this was the right place. Plus, the venue itself was relatively close to a tube station and a pub. Perfect, right? The inside was just right for the crowd we&#8217;d anticipated, it seated everyone pretty comfortably without people being too cramped or too spread out. Kings College London also catered the event, which meant that we didn&#8217;t have to get catering from another vendor.</p>
<p><strong>So a big thanks to Mochi with helping us out with the venue, food, &amp; beverages for the event! :)<br />
</strong></p>
<div id="attachment_714" class="wp-caption aligncenter" style="width: 490px"><a href="http://chris-jeff.com/wp-content/uploads/2011/09/6107352518_ce3a6b2c1b_z.jpg"><img class="size-full wp-image-714" style="border: 0px;" title="Chowline" src="http://chris-jeff.com/wp-content/uploads/2011/09/6107352518_ce3a6b2c1b_z.jpg" alt="The line for lunch! Nom." width="480" height="640" /></a><p class="wp-caption-text">The line for lunch! Nom.</p></div>
<h2>First Steps</h2>
<p>We started to discuss potential ideas of ramping up the meetup and getting it to a level where we could potentially attract more attendees than just the regular handful. We toyed with the idea of getting sponsors and going down that route of making it more of an official conference than just a meet up, but that whole idea didn&#8217;t really appeal to us, we wanted a more official meet up, however still cater to the whole idea of it being by developers for developers. We settled on the idea that it would be best to get Mochi Media directly involved, especially since this was coming directly from their community! However, we still wanted to keep the whole conference style and not just sitting in a pub, so we threw ideas around about getting a venue and speakers and making a whole day out of it.<br />
We were moving in a different direction from the typical meetups, a direction that I was really excited about! That said, we still liked the <em>idea</em> of our pub meetup (Being from Newcastle I guess maybe?) So we ended up including the pub portion as well and made it a two day event to keep with Mochi London tradition.</p>
<div id="attachment_735" class="wp-caption aligncenter" style="width: 590px"><a href="http://chris-jeff.com/wp-content/uploads/2011/09/6107323626_9b837d414b_z.jpg"><img class="size-full wp-image-735 " style="border: 0px;" title="6107323626_9b837d414b_z" src="http://chris-jeff.com/wp-content/uploads/2011/09/6107323626_9b837d414b_z.jpg" alt="Merlin Gore - Importance of personal branding - As you can see, I'm all branded, Huzah!" width="580" height="436" /></a><p class="wp-caption-text">Merlin Gore - Importance of personal branding - As you can see, I&#39;m all branded, Huzah!</p></div>
<h2>Speakers</h2>
<p>Once we had the idea locked down, it was time to get the event pumped with solid content that would get the Flash games community excited about the event! For some, this can be a pretty daunting and time consuming experience- trying to get quality speakers with content people actually want is no easy task. My approach: I kept it real simple and just thought of what I&#8217;d want to hear! Sounds a little egocentric, but I&#8217;m an indie developer and I know exactly what I&#8217;d want to hear and from who- so why not get them to speak!? Makes sense, right?</p>
<div id="attachment_726" class="wp-caption aligncenter" style="width: 590px"><a href="http://chris-jeff.com/wp-content/uploads/2011/09/6107354042_dc2bc5fee9_o1.jpg"><img class="size-full wp-image-726 " style="border: 0px;" title="The day!" src="http://chris-jeff.com/wp-content/uploads/2011/09/6107354042_dc2bc5fee9_o1.jpg" alt="Day 1 schedule!" width="580" height="436" /></a><p class="wp-caption-text">Day 1 schedule! - Look how far we&#39;ve come!</p></div>
<p>We ended up with a pretty strong line up of speakers, with content that covers a wide variety of topics within the Flash games industry. Perfect in my eyes!</p>
<blockquote>
<ul>
<li>Iain Lobb (freelance Flash / ActionScript developer)</li>
<li>Stuart Allen (creator of Gravitee Wars)</li>
<li>Martine Spaans (Ubisoft, formerly of SPIL Games)</li>
<li>Michael Hudson &amp; Steven Gurevitz (CodeHeads / 2002 studios)</li>
<li>Merlin Gore (Flash developer, FlashGameLicense.com)</li>
<li>Mike Jones (Platform Evangelist, Adobe Systems)</li>
<li>Colin Cupp &amp; Ryan Nichols (Mochi Media)</li>
</ul>
</blockquote>
<h2>Day of the Event!</h2>
<p>A few of us kicked off the day a little earlier in order to get set up and also to ensure that everything was in proper working order. Registration opened at 9:00am and it wasn&#8217;t long after that when we started to see people arrive! Personally I felt really great when people started flooding in, as beating 8 attendees for a community event is a milestone for Mochi London ;). And they didn&#8217;t stop- we ended up with about 50+ people eager for the antics that the day would bring, in the form of presentations of course.</p>
<div id="attachment_639" class="wp-caption aligncenter" style="width: 590px"><a href="http://chris-jeff.com/wp-content/uploads/2011/09/6107323378_c4ed9bf6ea_o.jpg"><img class="size-full wp-image-639  " style="border: 0px;" title="6107323378_c4ed9bf6ea_o" src="http://chris-jeff.com/wp-content/uploads/2011/09/6107323378_c4ed9bf6ea_o.jpg" alt="Mochi London 2011" width="580" height="436" /></a><p class="wp-caption-text">Mochi London 2011 - All the happy faces :)</p></div>
<p>I honestly feel the day couldn&#8217;t have gone any better, unless we actually went to Nando&#8217;s afterwards (inside joke and my personal obsession)!! All the speakers were started on-time and covered their topics extremely well. Questions were asked by engaged attendees, and they received some really in-depth responses. There were moments when the conversation moved from the presenters out to the audience, which was exactly the type of attendee interaction we were hoping for. Overall, the whole day was really informative and went exactly to plan (minus Nando&#8217;s, not fair!).</p>
<h2>Day Two</h2>
<p>The day that consisted of drinks and random chats about Flash game development, experiences and stat sharing! Exactly what Mochi London started off as, so this couldn&#8217;t go wrong at all! We totally kept up with tradition and met up at the<span> <a href="http://www.jdwetherspoon.co.uk/home/pubs/the-montagu-pyke">Montagu Pyke pub</a> which is where the first meet up was held! It&#8217;s a nice, open venue with a solid Sunday roast&#8230;and it&#8217;s reasonably priced!</span></p>
<p>We met up at 8pm and finished at around 10:30pm, then  went on the hunt for food! Of course, I suggested Nando&#8217;s (As always!), however we missed it by around 5 minutes, I&#8217;m not sure what I&#8217;ve done, but karma wasn&#8217;t on my side for that day! Or the day before&#8230;</p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_668" class="wp-caption aligncenter" style="width: 509px;">
<p class="wp-caption-dt" style="text-align: center;"><a href="http://chris-jeff.com/wp-content/uploads/2011/09/6106804911_1656b7a58a_o.jpg"><img class="size-full wp-image-668  " style="border: 0px;" title="6106804911_1656b7a58a_o" src="http://chris-jeff.com/wp-content/uploads/2011/09/6106804911_1656b7a58a_o.jpg" alt="Day one meal. Eating Ramen with a fork is how we do it up North!" width="499" height="374" /></a></p>
<dd class="wp-caption-dd">Day one meal. Eating Ramen with a fork is how we do it up North!</dd>
</dl>
</div>
<h2>Closing Thoughts</h2>
<p>I personally thought the whole event went to plan- in fact, it couldn&#8217;t have gone any better as far as I&#8217;m concerned! This was a great step for Mochi London. We&#8217;re definitely going to be preparing for Mochi London 2012 due to the popularity of this year&#8217;s event! My hope is to be able to take it up another notch with more quality speakers who have a strong presence in the Flash games industry, as well as keeping the event as fun and informative as possible. In the end, Mochi London is all about the community.</p>
<p>So on that note, Mochi London 2012 anyone?!</p>
<div id="attachment_723" class="wp-caption aligncenter" style="width: 590px"><a href="http://chris-jeff.com/wp-content/uploads/2011/09/6106804529_f0ea422f14_o.jpg"><img class="size-full wp-image-723" title="Robinson!" style="border: 0px" src="http://chris-jeff.com/wp-content/uploads/2011/09/6106804529_f0ea422f14_o.jpg" alt="6106804529_f0ea422f14_o" width="580" height="436" /></a><p class="wp-caption-text">Robinson and his heroic efforts at manning the reception booth, thanks Robinson!</p></div>
<p>I&#8217;d love to hear thoughts and ideas for next year, we want to make it even better! Feel free to <a href="http://chris-jeff.com/contact/" target="_blank">contact me!</a></p>
<p>I&#8217;d also like to thank everyone involved in making Mochi London 2011 what is was on the day! From the Mochi Media team, to the speakers, and most importantly to the attendees who turned up- thanks everyone!</p>
<p>&nbsp;</p>
<h2>Presentations? We Have Presentations!</h2>
<p>Check out the presentation slides from the speakers of Mochi London 2011</p>
<h4>
<div style="width:425px" id="__ss_9261072"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mochimedia/mobile-gaming-is-it-the-future-by-michael-hudson-and-steven-gurevitz" title="Mobile Gaming: Is It The Future? by Michael Hudson and Steven Gurevitz" target="_blank">Mobile Gaming: Is It The Future? by Michael Hudson and Steven Gurevitz</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9261072" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/mochimedia" target="_blank">mochimedia</a> </div>
</p></div>
<div style="width:425px" id="__ss_9261055"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mochimedia/gravitee-wars-post-mortem-by-stuart-allen-of-funky-pear" title="Gravitee Wars Post Mortem by Stuart Allen of FunkyPear" target="_blank">Gravitee Wars Post Mortem by Stuart Allen of FunkyPear</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9261055" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/mochimedia" target="_blank">mochimedia</a> </div>
</p></div>
<div style="width:425px" id="__ss_9261069"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mochimedia/martine-spaans" title="Player Behaviour by Martine Spaans" target="_blank">Player Behaviour by Martine Spaans</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9261069" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/mochimedia" target="_blank">mochimedia</a> </div>
</p></div>
<div style="width:425px" id="__ss_9261067"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mochimedia/iain-lobb" title="Game Design for Game Developers by Iain Lobb" target="_blank">Game Design for Game Developers by Iain Lobb</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9261067" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/mochimedia" target="_blank">mochimedia</a> </div>
</p></div>
<div style="width:425px" id="__ss_9261071"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mochimedia/the-importance-of-personal-branding-by-merlin-gore" title="The Importance of Personal Branding by Merlin Gore" target="_blank">The Importance of Personal Branding by Merlin Gore</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9261071" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/mochimedia" target="_blank">mochimedia</a> </div>
</p></div>
<div style="width:425px" id="__ss_9261062"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/mochimedia/colin-ryan" title="What&#39;s New At Mochi! by Colin Cupp and Ryan Nichols" target="_blank">What&#39;s New At Mochi! by Colin Cupp and Ryan Nichols</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9261062" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/mochimedia" target="_blank">mochimedia</a> </div>
</p></div>
<div style="width:425px" id="__ss_9178678"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/FlashGen/mochi-london-2011" title="Mochi London 2011" target="_blank">Mochi London 2011</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/9178678" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/FlashGen" target="_blank">Mike Jones</a> </div>
</p></div>
</h4>
<h3>Pictures!</h3>
<p>Check out the pictures on <a href="http://www.flickr.com/photos/mochimedia/sets/72157627454485113/" target="_blank">Mochi&#8217;s phototstream</a> to see pictures taken throughout the weekend!</p>
<h3>Videos</h3>
<p>I&#8217;ll be sharing the videos of the speakers in a later post as we&#8217;ve got to get all the footage in one place and edit a bit (as it&#8217;s recorded from a tablet). So keep an eye out! :)</p>
<p>&nbsp;<br />
<strong><em>Thanks for reading!</em><br />
</strong></p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; ChrisJeff for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/recap-mochi-london-2011">Permalink</a> |
	  <a href="http://mochiland.com/articles/recap-mochi-london-2011#comments">6 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/recap-mochi-london-2011&amp;title=Recap: Mochi London 2011">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/recap-mochi-london-2011" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/flash" title="View all posts in Flash Development" rel="category tag">Flash Development</a>, <a href="http://mochiland.com/category/mochiland/front-page" title="View all posts in Front Page" rel="category tag">Front Page</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland/games-industry" title="View all posts in Games Industry" rel="category tag">Games Industry</a>, <a href="http://mochiland.com/category/mochiland/mochi-media-announcements" title="View all posts in Mochi Media Announcements" rel="category tag">Mochi Media Announcements</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>, <a href="http://mochiland.com/category/mochiland/publisher-feed" title="View all posts in Publisher Feed" rel="category tag">Publisher Feed</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/recap-mochi-london-2011/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The Making of BioGems</title>
		<link>http://mochiland.com/articles/the-making-of-biogems-by-dominique-ferland</link>
		<comments>http://mochiland.com/articles/the-making-of-biogems-by-dominique-ferland#comments</comments>
		<pubDate>Fri, 02 Sep 2011 21:32:14 +0000</pubDate>
		<dc:creator>DominiqueFerland</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Game Showcase]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[BioGems]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[post-mortem]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5422</guid>
		<description><![CDATA[BioGems: &#8220;The Making Of&#8221; Introduction BioGems is Mochi Media&#8217;s first in-house game, which can be found in the Mochi Media games catalog. It&#8217;s a puzzle battle game in which space pets fight to protect their planet. By matching gems on a board, the player gets his pet to attack the opponent, defend itself for a [...]]]></description>
			<content:encoded><![CDATA[ <h1>BioGems: &#8220;The Making Of&#8221;</h1>
<h2><span>Introduction</span></h2>
<p><a href="http://www.mochimedia.com/games/play/biogems/">BioGems</a> is Mochi Media&#8217;s first in-house game, which can be found in the <a href="http://www.mochimedia.com/games/play/biogems/">Mochi Media games catalog</a>. It&#8217;s a puzzle battle game in which space pets fight to protect their planet. By matching gems on a board, the player gets his pet to attack the opponent, defend itself for a while, regenerate some health or energy, or fill up its Rage meter.</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image08.png"><img class="alignleft size-full wp-image-5435" style="border: 0px;" title="image08" src="http://mochiland.com/wp-content/uploads/2011/08/image08.png" alt="" width="582" height="388" /></a></p>
<h2><span>Building a Team</span></h2>
<p>My name is <strong>Dominique Ferland</strong> and I&#8217;m the game designer of <a href="http://www.mochimedia.com/games/play/biogems/">BioGems</a>. Before I joined Mochi, I worked on console games for about 4 years in Montreal. My title was never clear &#8211; something of a mix between an artist and a game designer. Growing tired of large-scale projects, I started making games in my spare time. The last game I made is the gamer trivia title, Geek Mind, which put me on Jameson&#8217;s radar for a Mochi in-house title. As soon as Jameson made an offer for me to start a development team and make fun games, I said goodbye to my old job!</p>
<p>CEO and co-founder of everything Mochi, <strong>Jameson Hsu</strong> is the best boss in the world. His vision for games is pretty simple &#8211; making awesome games he&#8217;d love to play. As we shared our love for games and discussed our game ideas, it was clear that we&#8217;d make a good creative team. As you&#8217;ll see in this post-mortem, Jameson&#8217;s input in the design and in the production really helped keep BioGems simple and super fun.</p>
<p>As Jameson and I were developing our puzzle game idea, we realized we would need a super programmer to join the team &#8211; that&#8217;s when Jameson found <strong>Nico Tuason</strong>, Master of Flash. Based in the Philippines, Nico has been making games and other Flash projects for years. He really impressed us with his little indie gems, <a href="http://armorgames.com/play/7556/desert-moon">Desert Moon</a> and <a href="http://shockarcade.com/solarmax">SolarMax</a>, which really showcased his creative programming skills. Each time he&#8217;d add something to the game, it would be super polished, animated and tweaked to perfection. And he&#8217;s just an awesome dude.</p>
<p><strong>Brian McBrearty</strong>, musical genius, joined in a bit later in development to add all the bleeps and bloops, the loud gem explosions and the awesome music. He did it all with such ease and awesomeness that it was kind of scary. Brian has designed sound and music for tons of films, games and other media &#8211; check out his <a href="http://www.brianmcbrearty.com/">blog</a> for all that craziness.</p>
<p>Enough about us, let&#8217;s talk about the game!</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image14.jpg"><img class="alignleft size-full wp-image-5437" style="border: 0px;" title="image14" src="http://mochiland.com/wp-content/uploads/2011/08/image14.jpg" alt="" width="582" height="294" /></a></p>
<h2><span>Game, Set, Match-3</span></h2>
<p>Since our brand new team was creating our first game together, our instinct was to make something small, manageable and simple. We&#8217;d take basic gameplay that we all knew and loved and just see if we could make it quickly. We actually had many basic game prototypes created around well-known game types with generic art and no polish at all. We soon realized that these were just boring, uninspired clones so I had a new task &#8211; making these interesting with a fresh theme and clever twists to the gameplay, something to make us stand out from the crowd.</p>
<p>I pitched 3 game ideas, on which I had <em>carte blanche</em> for theme and looks. The first was a quirky cooking-themed <em>Puzzle Bobble clone</em>, the second an Indiana Jones-style archeology-themed <em>Puzzle Fighter</em>, and the last one was a mad scientist battle <em>Bejeweled</em> game. Here are the pictures I sent to Jameson, along with the pitch for the third idea.</p>
<p>&nbsp;</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image00.jpg"><img class="alignleft size-full wp-image-5438" style="border: 0px;" title="image00" src="http://mochiland.com/wp-content/uploads/2011/08/image00.jpg" alt="" width="280" height="401" /></a> <a href="http://mochiland.com/wp-content/uploads/2011/09/image16.jpg"><img class="alignright size-full wp-image-5463" style="border: 0px;" title="image16" src="http://mochiland.com/wp-content/uploads/2011/09/image16.jpg" alt="" width="258" height="401" /></a></p>
<p><span><strong><em>Food Bubbles &amp; Spelunquest, 2 not-so-good ideas</em></strong></span></p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image20.jpg"><img class="alignleft size-full wp-image-5439" style="border: 0px;" title="image20" src="http://mochiland.com/wp-content/uploads/2011/08/image20.jpg" alt="" width="582" height="416" /></a></p>
<p><span><strong><em>The very first mock screen for BioGems</em></strong></span></p>
<blockquote><p><em><span>For the moment, the board consists of colored gems that contain little organisms that look like basic monsters. The player gathers these miniature monsters, then mixes them up to create monsters with many different effects. For example, I&#8217;d need 6 yellow gems (skeletons) and 6 blue gems (octopi) to activate the Skeltopus (or something!), which either deals damage to the other player or has some special effect. Every time a power activates, a little image of the activated monster would appear with its name and its effect. For example, I gathered red and green and used &#8220;Phoenix&#8221;, and a cool-looking cartoony phoenix would appear with &#8220;PHOENIX: Deal X damage and play an extra turn after this one&#8221;.</span></em></p>
<p><em><span> </span></em><em><span> Characters would be stylish scientists (yes, I will make them cool), with different pre-selected sets of monsters.</span></em></p></blockquote>
<p>We opted to work on the third idea, which I would refer to as <strong>Science Quest</strong> &#8211; a pretty lame name now that I think about it! The player would play as a scientist battling his peers with science, merging together mutated animal genes to create monstrous things to attack the opponent. The board was populated with gems, each imprinted with little creature types, as well as viruses and money.</p>
<h2><span>How gameplay won over theme</span></h2>
<p>As weeks passed by, Jameson and I exchanged ideas and tweaked the game via e-mail. We kept a short design document detailing the game&#8217;s systems, abilities and characters, which was very useful to keep the scope of the game under control and as a starting point for our soon-to-join programmer. The game changed a lot during pre-production &#8211; here&#8217;s a short history of how we dumped science for sci-fi pets!</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image15.jpg"><img class="alignleft size-full wp-image-5440" style="border: 0px;" title="image15" src="http://mochiland.com/wp-content/uploads/2011/08/image15.jpg" alt="" width="582" height="179" /></a></p>
<p><span><strong><em>The original title banner</em></strong></span></p>
<p>The name BioGems appeared quite early in the process. I just sent this e-mail to Jameson, who approved right away! It sure is catchier than Science Quest!</p>
<blockquote><p><em>&#8220;Since the players will be mixing up gems that contain some sort of genetic material for creatures, I thought of <strong>GeneGems</strong> or <strong>BioGem</strong> as the game&#8217;s name&#8230; What do you think? &#8220;</em></p></blockquote>
<p>As an artist, user interface designer and game designer, I like putting together mock screens of the game I have in mind as early as possible. These fake screens make me ask myself a few questions. Does this look like a game I would play? Would a player understand the game right away? Is there a major design problem that couldn&#8217;t be seen in a design document, maybe with space, clutter, or colors?</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image17.jpg"><img class="alignleft size-full wp-image-5441" style="border: 0px;" title="image17" src="http://mochiland.com/wp-content/uploads/2011/08/image17.jpg" alt="" width="582" height="437" /></a></p>
<p><span><strong><em>A first iteration I never showed anyone before!</em></strong></span></p>
<p>As the game evolves, I keep modifying the mock-ups until they become the actual interface design files. It&#8217;s a very useful tool to discuss gameplay with teammates since almost every aspect of the game is shown in the screens.</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image18.jpg"><img class="alignleft size-full wp-image-5442" style="border: 0px;" title="image18" src="http://mochiland.com/wp-content/uploads/2011/08/image18.jpg" alt="" width="582" height="416" /></a></p>
<p><span><strong><em>Squares turn into bubbles, energy bars are clearer, and life bars evolve</em></strong></span></p>
<p>Even at this early state, you can see RPG elements start to appear. We all agreed that collecting money, buying upgrades and customizing your character would give the player a nice feeling of progression. Now we realize it&#8217;s a lot of work to code, but ultimately was totally worth it!</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image03.jpg"><img class="alignleft size-full wp-image-5443" style="border: 0px;" title="image03" src="http://mochiland.com/wp-content/uploads/2011/08/image03.jpg" alt="" width="582" height="416" /></a></p>
<p><span><strong><em>Placeholder portraits for scientists based on Spock and Futurama&#8217;s Zoidberg.The &#8220;Special&#8221; bar would eventually become the Rage Meter!</em></strong></span></p>
<p>The original design, similar to the great <em>Puzzle Quest</em>, had lots of resource gathering. The player would need to match and collect different types of cells before they could use the wide variety of special abilities. Many turns would be spent collecting instead of fighting &#8211; it seemed a bit boring, so we switched to a more direct approach. Matching gems of a certain type now instantly triggers an action, making battles more intense. It also removed the extra layer of complexity in the many special abilities. A casual player would get confused with too many different effects and conditions, plus programming all of the abilities would overwhelm our very small team of one guy!</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image06.jpg"><img class="alignleft size-full wp-image-5444" style="border: 0px;" title="image06" src="http://mochiland.com/wp-content/uploads/2011/08/image06.jpg" alt="" width="582" height="416" /></a></p>
<p><span><strong><em>Bubbles turn into gems and the timer appears.<br />
The energy bar also makes its first appearance, then named &#8220;Special&#8221;.</em></strong></span></p>
<p>When we ditched the different resources, we were exposed to a huge challenge &#8211; giving each gem type an action and making sure the player would understand it quickly and clearly. At that point, matching bird gems would restore life, matching beast gems would raise energy&#8230; It really didn&#8217;t make any sense, so we replaced animals with clear icons. The icons on the gems and whether to put text on them or not were the toughest interface design issues we ran into.</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image04.jpg"><img class="alignleft size-full wp-image-5445" style="border: 0px;" title="image04" src="http://mochiland.com/wp-content/uploads/2011/08/image04.jpg" alt="" width="582" height="416" /></a></p>
<p><span><strong><em>Placeholder art for monsters &#8211; I used Pikachu and Dragon Quest&#8217;s slime temporarily, to see how much space pet monsters would take.<br />
The timer is refined, bar&#8217;s colors are tweaked and text appears on the gems.</em></strong></span></p>
<p>Now that the animals weren&#8217;t on the board anymore, the scientist battle idea was pretty much run into the ground. For a while, we made it so that scientists would each have a pet to battle with, Pokemon-style, using the gems to command it. It felt a bit off, and when I got to writing and designing the introduction and cut-scenes with the scientists I just cut them off completely, leaving only the pets, fighting on their own. It made for a much simpler story to tell through comic book cut-scenes &#8211; no need to explain the relationship between scientist and pet, why they&#8217;re using them, and so on. The minimal science-fiction story I wrote was simple enough to tell quickly and without text &#8211; there are space invaders, and you must fight them!</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image13.jpg"><img class="alignleft size-full wp-image-5446" style="border: 0px;" title="image13" src="http://mochiland.com/wp-content/uploads/2011/08/image13.jpg" alt="" width="582" height="388" /></a></p>
<p><span><strong><em>The final gems are finally here, along with the Rage Meter.</em></strong></span></p>
<h2><span>Monster Gallery</span></h2>
<p>At first, when I was thinking about the battling pets, I sketched a bunch of weird monsters. None were really that exciting and creating a group that would fit well together seemed like a huge challenge &#8211; until Jameson suggested making them animals. Everything clicked when I put a space suit on a cute, bad-ass bear. I went on to design the enemy space suit and the rest of the cast was pretty easy to complete. The bear was originally supposed to be a playable character, but we opted for classic house pets as playable characters, and tougher animals for the enemies. Here&#8217;s a somewhat chronological gallery of the character design for BioGems!</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image19.jpg"><img class="alignleft size-full wp-image-5447" style="border: 0px;" title="image19" src="http://mochiland.com/wp-content/uploads/2011/08/image19.jpg" alt="" width="582" height="847" /></a></p>
<p>The animation team did a wonderful job with BioGems&#8217; characters. I wrote short descriptions of each character&#8217;s animations in a spreadsheet format and sent it over. We began with one character at a time, to establish a good style and create a template for the rest of the cast. The spreadsheet sent to the animators looked something like this:</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image01.jpg"><img class="alignleft size-full wp-image-5448" style="border: 0px;" title="image01" src="http://mochiland.com/wp-content/uploads/2011/08/image01.jpg" alt="" width="582" height="178" /></a></p>
<p>They sent us Flash files showcasing all animations on a single page, then we&#8217;d comment and ask for some changes. When we were satisfied with the first few characters, we gave the green light for all 12 characters and added each one to the game as soon as possible &#8211; seeing the game come to life in such a fantastic fashion was such a motivation boost!</p>
<h2><span>Precioussss</span></h2>
<p>The look of the gems evolved slowly. Jameson asked for objects that looked more like precious gems or diamonds, while I was worried about clarity. We showed a bunch of different gem designs to people around us, eventually settling on the current icons without labels.</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image09.png"><img class="alignleft size-full wp-image-5449" style="border: 0px;" title="image09" src="http://mochiland.com/wp-content/uploads/2011/08/image09.png" alt="" width="582" height="90" /></a></p>
<p><span><strong><em>The very first set was quite square! The over-detailed images inside the squares looked terrible on the board.</em></strong></span></p>
<p><span><strong><em><a href="http://mochiland.com/wp-content/uploads/2011/08/image11.png"><img class="alignleft size-full wp-image-5450" style="border: 0px;" title="image11" src="http://mochiland.com/wp-content/uploads/2011/08/image11.png" alt="" width="582" height="91" /></a></em></strong></span></p>
<p><strong><em>The bubbly second set, which looked okay but lacked any 3d-ness. Icons were also hard to see.</em></strong></p>
<p><strong><em><a href="http://mochiland.com/wp-content/uploads/2011/08/image02.png"><img class="alignleft size-full wp-image-5451" style="border: 0px;" title="image02" src="http://mochiland.com/wp-content/uploads/2011/08/image02.png" alt="" width="582" height="112" /></a></em></strong></p>
<p><strong><em>Simplified creature icons are imprinted on these octogonal stones. I still love those icons, but they really were detrimental to gameplay.</em></strong></p>
<p><strong><em><a href="http://mochiland.com/wp-content/uploads/2011/08/image12.png"><img class="alignleft size-full wp-image-5452" style="border: 0px;" title="image12" src="http://mochiland.com/wp-content/uploads/2011/08/image12.png" alt="" width="582" height="104" /></a></em></strong></p>
<p><strong><em>Creatures are replaced with icons. A test with text on the gems helps understand the gameplay, but really messes up the board&#8217;s readability. The stones still don&#8217;t look like precious gems, so we change them in the next iteration.</em></strong></p>
<p><strong><em> </em></strong></p>
<p><strong><em> </em></strong></p>
<p><strong><em> </em></strong></p>
<p><strong><em> </em></strong></p>
<p><strong><em> </em></strong></p>
<p><strong><em> </em></strong></p>
<p><strong><em> </em></strong></p>
<p><span><strong><em> <a href="http://mochiland.com/wp-content/uploads/2011/08/image21.png"><img class="alignleft size-full wp-image-5453" style="border: 0px;" title="image21" src="http://mochiland.com/wp-content/uploads/2011/08/image21.png" alt="" width="582" height="76" /></a></em></strong></span></p>
<p><strong><em> </em></strong></p>
<p><strong><em>The last look is created from gems, emeralds and diamonds. We change the icons again to something even clearer and we add the amazing rainbow black hole.</em></strong></p>
<h2><span>It&#8217;s a Small World</span></h2>
<p>Now that the main gameplay seemed pretty solid, we had to design a single-player experience around it. The player would progress through a series of enemies until he defeated the last boss. I came up with two completely different models. Terrified by the complexity of the somewhat larger second model, Jameson gave the green light to the linear model. I was kind of frustrated at first, but this was totally the right call &#8211; the game would never have seen the light of day in that crazy over-sized model!</p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image07.jpg"><img class="alignleft size-full wp-image-5454" style="border: 0px;" title="image07" src="http://mochiland.com/wp-content/uploads/2011/08/image07.jpg" alt="" width="552" height="1048" /></a></p>
<p><span><strong><em>The simple model is pretty straightforward, like old school arcade fighting games.</em></strong></span></p>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image10.jpg"><img class="alignleft size-full wp-image-5455" style="border: 0px;" title="image10" src="http://mochiland.com/wp-content/uploads/2011/08/image10.jpg" alt="" width="582" height="861" /></a></p>
<p><span><strong><em>I really wanted to give the player more choices in where to go, what to do &#8211; but it was too much work!</em></strong></span></p>
<p>The crazy thing is, there was a third model &#8211; an actual turn-based strategy game, complete with resource gathering, territorial control, micro-management, and all that jazz! I would show you the model, but it doesn&#8217;t even fit in a web browser!</p>
<p>Controlling the scope of the game is very hard to do. Even the game as it is now was a bit too ambitious for our team size and our schedule &#8211; Nico was a bit overwhelmed by all the features we kept adding, while Jameson and I were struggling with making everything user friendly. Even a basic world map and upgrade system such as ours requires a lot of testing and balancing, so I&#8217;m really glad we kept the game small.</p>
<h2><span>Using the hivemind</span></h2>
<p>Alternating between game design and art kept development fresh for me, doing a bunch of different tasks every week. Nico was now coding the match-3 gameplay super fast, adding layers of polish early, programming menus, doing smooth transitions between screens, while I was designing the world map, creating the shop and polishing the interface. The whole team met in San Francisco for 2 weeks during GDC 2011, and being in the same room with everyone was the most effective time working on BioGems. There was a strong synergy between us, since all team members were so excited about the game coming together at last. While I was almost done with my tasks, Nico was working 12 hour days tying it all together and adding tons of polish. Nico made sure we had daily BioGems builds to dig through to find bugs and balance difficulty.</p>
<p>As soon as we had a playable ladder of opponents, we had a bunch of friends and co-workers test the game&#8217;s usability. The lovely employees over at the Mochi offices in San Francisco provided us with much needed insight. Having worked on the game for so long, we were comfortable with the gameplay and the interface, but testers had a rough time understanding what was happening on screen. Here are a few things we fixed thanks to testing.</p>
<h4>Confusing icons</h4>
<blockquote><p>The red gem, which fills up your Rage Meter, originally had a skull icon. Some hardcore gamer testers got confused &#8211; in a similar title, <em>Puzzle Quest</em>, the main way to damage your opponent is by matching skulls. We decided to change it to a fire icon, which makes more sense anyway!</p></blockquote>
<p>&nbsp;</p>
<h4>Cues for player action were missing </strong><strong> </h4>
<blockquote><p>Players had a tough time knowing when it&#8217;s their turn, when they should play. Some casual players didn&#8217;t even notice that the enemy was taking turns &#8211; we got scared, so we added a bunch of hints as to when it&#8217;s the player&#8217;s turn and when it&#8217;s the opponent&#8217;s. Now there&#8217;s a big &#8220;Make your move&#8221; on the left, a &#8220;Your Turn&#8221; or &#8220;Opponent&#8217;s Turn&#8221; image that pops up between turns and the board changes from blue to red depending on who&#8217;s turn it is.</p></blockquote>
<p>&nbsp;</p>
<h4>The game didn&#8217;t show stats and damage numbers </h4>
<blockquote><p>One tester mentioned he&#8217;d like to understand the mathematics behind each attack, so he could customize and plan strategies better. That&#8217;s when Nico added the damage numbers to the combat animations, which really improves the action and helps advanced players build a proper strategy around those.</p></blockquote>
<p>&nbsp;</p>
<h4>The timer was too hardcore </h4>
<blockquote><p>At first, the timer was set at about 10 seconds. The dev team had a lot of fun with that fast-paced version, but the casual player and the chess players were really annoyed by the &#8220;Time&#8217;s Up!&#8221; pop-up. We then upped the time limit to 20 seconds to cater to more players.</p></blockquote>
<p>&nbsp;</p>
<h4>Gem types were a bit confusing at first </h4>
<blockquote><p>For a new player, the first challenge is to understand what each gem type does. We tweaked colors and icons as much as we could, introduced tutorials in the first battle and added a help section. Ultimately though, our short duration test sessions were a bit misleading &#8211; it&#8217;s really something the player learns by playing the game, by matching gem types over and over. Usually by the second battle players understand each gem type enough to win and keep going.</p></blockquote>
<p>&nbsp;</p>
<h4>Getting difficulty just right</h4>
<blockquote><p>In terms of difficulty for the whole campaign, Jameson and I did most of the testing (Brian and his kid also helped a lot). We just powered through my balancing builds, tweaking enemies to make it challenging but not frustrating. Nico provided me with a file containing all the character stats and a flexible build that I could compile myself, so that I wouldn&#8217;t drive him crazy with a balancing tweak every 2 minutes!</p>
<p>The luck factor being quite high in match-3 games, a single play through was never representative of the game&#8217;s actual difficulty, so we had to play the game hundreds of times, writing down wins and losses, trying out different upgrade schemes, and even playing like newbies. The fact that I still play BioGems after hundreds of hours playing it over and over again might be a sign that we did something right!</p>
<p>Instead of having each enemy be a little stronger than the previous one, I tried to have one easy, one tough and one super tough, then go back to a somewhat easier enemy. That kind of non-linear cycle keeps the game fresh and surprising, in my opinion. I also tried to put some variety in the enemy behavior &#8211; for example an enemy might not have strong attacks or lots of health, but he&#8217;ll make up for it with a surprising counter or rage stat.</p></blockquote>
<p>&nbsp;</p>
<h4>Controlling the Artificial Intelligence </h4>
<blockquote><p>Advanced gamers complained a little about the enemy&#8217;s lack of advanced artificial intelligence. In the test version, just like in the final version, the enemy did not always go for the best available move on the board, and would sometimes forget about match-4&#8242;s and extra turns. Well, in one very tough build, Nico upgraded the A.I. to an epic level of intelligence. Enemies would wipe out the player in a couple turns by taking consecutive extra turns, doing huge combos and creating bombs all the time &#8211; it wasn&#8217;t fun anymore, so instead of re-balancing the whole game, we rolled back to the easier but more enjoyable behavior. The current A.I. is still quite advanced in terms of priorities and survival.</p></blockquote>
<h4>The little mistakes</h4>
<p>In every game&#8217;s development, some sacrifices must be made, some bad decisions are taken and some frustrations remain. Since we maintained an open mind about what the game was going to be and when it would be released, the list of negatives is pretty short, but let&#8217;s walk through them anyway, in proper Post-Mortem fashion.</p>
<p>&nbsp;</p>
<h4>We took for granted that people knew how to play a match-3 game. </h4>
<blockquote><p>With BioGems&#8217; core mechanics being strongly inspired by the classic Bejeweled, we took for granted that players would know how to play. Switching gems around on the board, creating rows of three or more matching gems, trying to get four or more in a row as often as possible, these were all obvious to us. But as we started testing the game with random people, some players were utterly confused by the very core of the game, not having played Bejeweled or its many siblings. We added lots of tutorials and hints, but I still feel that the game will be tough to play for a true casual player who has no idea what match-3 is.</p></blockquote>
<h4>Trying to please every type of gamer out there is a pretty tough thing to do &#8211; it might even be the wrong thing to do. </h4>
<blockquote><p>I would spend hours building a version that would be accessible to casual players, only to re-do it all after testing it with a hardcore match-3 player, wasting a lot of time in the process. At some point, we had to settle on a target for difficulty &#8211; we opted for an easy start and a rapidly increasing difficulty. Casual players would get a chance to learn how to play before being exposed to the game&#8217;s tougher core. Some players get frustrated when they hit the first difficulty peak, while others will suffer many losses near the end, but hopefully they&#8217;ll stick to the game and eventually defeat the last boss.</p></blockquote>
<p>&nbsp;</p>
<h4>We don&#8217;t have multiplayer! </h4>
<blockquote><p>Early reviews and comments often mention a missing feature they&#8217;d love to see in BioGems &#8211; multiplayer. Trust me when I say that everyone in the team agrees with that &#8211; I&#8217;d love to test Jameson&#8217;s skills one-on-one in a BioGems battle! Multiplayer is always a headache-inducing and time-consuming programming task, which probably would have sucked the life out of Nico. Looking at the development schedule, we made the tough call to leave multiplayer out of BioGemsí first release &#8211; but if the game catches on, we would definitely add multiplayer to its first update or its sequel.</p></blockquote>
<p>&nbsp;</p>
<h4>The game took a long time to make, overall </h4>
<blockquote><p>Because I was working full-time at another game company during BioGems&#8217; pre-production, the game grew rather slowly at first. As soon as I made MochiGames my only job and Nico joined the team, things started moving in a quicker fashion. In such a small team, there would obviously be some slow-downs whenever a team member would take a vacation or become ill, but ultimately the relaxed, laid-back development schedule kept all of us on a creativity high. I think this method is great, really &#8211; now that we are done with BioGems, we are still full of energy &#8211; we&#8217;re pumped and ready to start our next game!</p></blockquote>
<p><a href="http://mochiland.com/wp-content/uploads/2011/08/image05.jpg"><img class="alignleft size-full wp-image-5456" style="border: 0px;" title="image05" src="http://mochiland.com/wp-content/uploads/2011/08/image05.jpg" alt="" width="500" height="644" /></a></p>
<h2><span>Conclusion</span></h2>
<p>Everyone here at Mochi really enjoyed making BioGems what it is today. It might seem like a cliche thing to say, but I think it shows in the game we released. We hope our team&#8217;s efforts to really polish gameplay and visuals will please the players and keep them coming back. Keep an eye on <a href="http://www.mochigames.com">MochiGames.com</a> for updates on our projects and leave us comments and suggestions on the Forums!</p>
<p>Thanks for reading!</p>
<p>Dom</p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; DominiqueFerland for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/the-making-of-biogems-by-dominique-ferland">Permalink</a> |
	  <a href="http://mochiland.com/articles/the-making-of-biogems-by-dominique-ferland#comments">13 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/the-making-of-biogems-by-dominique-ferland&amp;title=The Making of BioGems">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/the-making-of-biogems-by-dominique-ferland" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/front-page" title="View all posts in Front Page" rel="category tag">Front Page</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland/featured-games" title="View all posts in Game Showcase" rel="category tag">Game Showcase</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/the-making-of-biogems-by-dominique-ferland/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Flash Game Developer Tips #9 by Photon Storm</title>
		<link>http://mochiland.com/articles/flash-game-developer-tips-9-by-photon-storm</link>
		<comments>http://mochiland.com/articles/flash-game-developer-tips-9-by-photon-storm#comments</comments>
		<pubDate>Tue, 05 Jul 2011 16:57:24 +0000</pubDate>
		<dc:creator>Photon Storm</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[MochiLand Topics]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[Photon Storm]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5099</guid>
		<description><![CDATA[Tip #9 &#8211; Dealing with a lack of motivation to finish your game You are not alone Everyone suffers from this problem at one point or another: You simply can&#8217;t face the thought of working on your game. This is especially hard when making the game in your &#8220;free time&#8221;. It&#8217;s all too easy to [...]]]></description>
			<content:encoded><![CDATA[ <p><img class="alignnone size-full wp-image-1126" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/02/Flash-Game-Dev-Tips-Header.png" alt="" width="640" height="80" /></p>
<p><strong>Tip #9 &#8211; Dealing with a lack of motivation to finish your game</strong></p>
<h2>You are not alone</h2>
<p>Everyone suffers from this problem at one point or another: You simply can&#8217;t face the thought of working on your game. This is especially hard when making the game in your &#8220;free time&#8221;. It&#8217;s all too easy to think &#8220;what the hell&#8221; and double-click that Team Fortress icon instead of FlashDevelop. And even days when your head is saying &#8220;let&#8217;s code!&#8221; all that motivation can vanish the moment you open the source and realise that its been so long since you were last here it&#8217;s like staring at a foreign language, or a giant brick wall and you have no idea what to start first.</p>
<p>There is no &#8220;single solution&#8221; to fix this. It&#8217;s extremely personal. Your reasons for not wanting, or being able to code will be as varied as the number of people reading this. But as I said at the start you are not alone &#8211; so I posed the question of how to deal with it to 13 fellow game developers and collated their replies. Hopefully somewhere in these insights you&#8217;ll find a technique or suggestion that helps you out. And if you have one that you personally use, not already mentioned, please post it into the comments.</p>
<p>I&#8217;ll kick things off &#8230;</p>
<h2>Richard Davey / Photon Storm</h2>
<p><a href="http://www.photonstorm.com" target="_blank">http://www.photonstorm.com</a></p>
<p><img class="alignleft size-full wp-image-1316" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/curudil-mockup.jpg" alt="" width="300" height="225" /></p>
<p>I&#8217;ve come to realise that I&#8217;ve a game development <em>mana reserve</em>. When I start work on a game, my mana reserve is full. But as coding begins this reserve drops faster and faster. Sometimes if I hit a†particularly†troublesome spot in a game it can be enough to utterly wipe-out what reserves I had left,†derailing the project entirely. But there are also the &#8220;wins&#8221;. Getting a significant part of the game finished, or adding something really cool. That helps re-fill my mana reserves and keeps motivation high. It&#8217;s a constant battle. To get the game finished before enthusiasm is depleted entirely, yet to have enough wins on-route that they keep things in balance.</p>
<p>The &#8220;wins&#8221; however cannot be artificially placed into the project. They have to be unexpected and grow almost organically as a result of †working on the game. Equally the hits to my morale are never expected either. I never start coding expecting to stump my toe on a †bug from hell, but it happens.</p>
<p>There are two issues here:</p>
<h3>1) Having the motivation to continue working on a game</h3>
<p>I think like a lot of people I&#8217;m most excited about a game during the very early stages of it. The feeling of bringing something to life, of getting the idea out of your head and into code &#8211; that&#8217;s a real achievement in and of itself. I enjoy the task of getting a working prototype up and running, often with really crappy code driving it. The thing to do at this stage is to try and work out for yourself if you should stop right now, and not even attempt to carry on.</p>
<h4>Use those prototypes</h4>
<p>There is nothing wrong in building a prototype and just leaving it at that. Of course if you&#8217;re in this for the money it&#8217;s not going to get you rich, but if like me you do this for fun then you shouldn&#8217;t feel any sense of &#8220;guilt&#8221; for having made just a prototype. If by this point you recognise that your enthusiasm is on the wane already then don&#8217;t just file it away for another day, thinking you&#8217;ll come back to finish it later on. Because almost certainly it will never happen. If you don&#8217;t have the enthusiasm or excitement at the end of this stage to take the game further, then you never will.</p>
<p>Don&#8217;t waste it though. Think about how what you&#8217;ve made could be useful to others. Perhaps it&#8217;d serve as an interesting &#8220;I made this little demo&#8221; post for your blog or a forum. Or maybe it could be turned into a tutorial for a development site with little modification. You may be surprised at the response. I&#8217;ve had people see &#8220;demos&#8221; of work who suggested just one change, that radically altered the course of the game, resulting in it being finished and released. As I mentioned at the start, &#8220;mana refills&#8221; can come from anywhere, sometimes the most unexpected of places.</p>
<h4>Do something other than making games</h4>
<p><img class="alignleft size-full wp-image-1317" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/sharkhunter.jpg" alt="" width="300" height="225" /></p>
<p>Making complete games is hard, there&#8217;s no doubting this. Even the most simple of games still require quite tedious boot strapping to make them suitable for release. But that &#8220;rush&#8221; and feeling of sheer joy you get when you finally publish doesn&#8217;t always have to come from making a game. As readers of my blog will know I work on a lot of game development projects such as my Flixel Power Tools or tutorials. I do this because I enjoy writing, but also because I remember what it was like being fresh to development &#8211; how I was a sponge, soaking up every last piece of information I could get my hands on.</p>
<p>There is a real thrill in authoring this type of content too, and publishing it. So you don&#8217;t feel like making a whole game? No problem &#8211; could you make a demo that showcased how to make a sprite jump from platform to platform? The scale is significantly smaller, but the end result could be extremely useful to your fellow developers. And their feedback can be enough to spur you on during the more†laborious†development work you need to do.</p>
<p>Of course the downside of all this writing is that it takes your time away from making actual games, as Ilija will attest to :)</p>
<h4>Public Beta Tests</h4>
<p>We ran a public beta test of a game called Kingdums. We just put a build of the game onto a web page with a big feedback form below it, and shouted the URL onto twitter. It was live for a week. The feedback we got was fantastic, because it under-lined a significant flaw in the game (that was in the back of our minds anyway, but made it prominent) and reaffirmed that actually, this flaw aside, people really enjoyed playing it. Other developers use public beta tests for similar reasons &#8211; lots do it to find out if their games have bugs they&#8217;ve missed, but it doesn&#8217;t just have to be about that. Sometimes you&#8217;ll get suggestions that highlight issues you didn&#8217;t see, and sometimes it&#8217;s just a good morale boost.</p>
<p>It&#8217;s not just code that can be tested &#8211; you could post-up screen shots, character bios, even basic story arcs. All things that feed back into the game overall.</p>
<h4>Enforced Time Constraints</h4>
<p>Some people don&#8217;t understand the point of making a game in a limited period of time. Others relish the challenge. Personally I fall somewhere in the middle. I haven&#8217;t yet had a chance to take part in something like <a href="http://www.ludumdare.com/" target="_blank">Ludum Dare</a>, because I have a family life that stops things like that happening over weekends. But the times that I have made a game in a limited period of time (we&#8217;ve done it 3 times now) it has always worked for the better. Todo lists get cut down dramatically. Only the essential game aspects are given attention, and the time limitation really does focus your mind. Try it, it may appeal to you.</p>
<h4>Using a To-Do List</h4>
<p>You&#8217;ll see this suggestion raised time and again by the other devs below. Ilija and I use the free software <a href="http://www.6wunderkinder.com/wunderlist/" target="_blank">Wunderlist</a>. I like the fact I can add items from my iPhone or PC and have it all sync-up properly. We don&#8217;t have lists for prototypes, only for games deep in development. I find it pointless starting a list with &#8220;make an enemy manager&#8221;, that feels too early-on in the process for us.</p>
<h3>2) Dealing with &#8220;getting stuck&#8221; while coding</h3>
<p>This is the easiest to solve. If you have a coding problem, then you ask for help. If you don&#8217;t work in an environment where you can ask fellow coders for suggestions, then there are hundreds of really great game dev communities online. And you should join one and really participate with it. Help out other people suffering problems you may already solved, and post your problems up there also. More often than not someone will help, or at least direct you onto the right path that leads to solving the problem anyway. If you can&#8217;t solve the issue within a couple hours of trying, and <em>can&#8217;t think of another way to approach it</em>, then you need a bring a second brain into the equation. The longer you delay in asking for help, the more chance you have of never finishing.</p>
<h3>Don&#8217;t feel guilty</h3>
<p><img class="alignleft size-full wp-image-1318" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/cupcakes.jpg" alt="" width="300" height="225" /></p>
<p>You&#8217;re only human. Human&#8217;s need a fine balance between work, rest and play. And developers are terrible at balancing those three elements. There&#8217;s a famous producer graph showing &#8220;Price &#8211; Speed &#8211; Quality&#8221;, with the mantra that you can only ever have 2 of those 3 things. So &#8220;Speed + Quality comes at the expensive of Price&#8221;, or &#8220;Low Price + Speed means low Quality&#8221;.</p>
<p>I feel that developers do the same with &#8220;Coding &#8211; Resting &#8211; Playing&#8221;. By &#8220;Playing&#8221; I mean taking time out from coding: watching a movie, spending time with your significant other, reading a book, playing Xbox, etc. Too much coding but the right amount of sleep usually means you give-up your &#8220;play&#8221; time. If you&#8217;re burning the candle at both ends, holding down an intensive day job and then coding all night, your Rest and Play can be sacrificed. If when you sit at your computer you find the code just isn&#8217;t flowing then stop. Don&#8217;t battle it, don&#8217;t trudge through. Just stop and do something else entirely (ideally non-computer based). Then try again the next day. If you&#8217;ve been working like mad all week, getting a few hours sleep a night, then pay off that sleep debt.</p>
<p>Development is a roller-coaster of highs and lows. If you recognise you&#8217;re on a coding streak then enjoy it and use it to your advantage, but when it ends (and it will end) switch track quickly and work on something else. Then switch back again. The quicker you learn to recognise your &#8220;moods&#8221; the more useful you can make them. I&#8217;m not perfect at this yet, not by a long shot. I still have lots of &#8220;unfinished&#8221; games, indeed the artwork I used to illustrate my text above is all taken from games I&#8217;ve not yet finished, and there are plenty more. But I never sit idle. I do at least work and release. If I&#8217;m not making a game, I&#8217;ll write, and if I&#8217;m not writing I&#8217;ll help out in a forum. If I&#8217;m not in there maybe I&#8217;ll be playing a little Counter Strike. The point is that I feel I do balance them well, one doesn&#8217;t over-power the other. I just wish I had more hours in the day :)</p>
<p>That&#8217;s me done with, now onto 13 other developers for their views on this subject &#8230;</p>
<p><span id="more-5099"></span></p>
<h2>John Cotterell</h2>
<p>&#8220;I make a point of working on something every day, even if only for a few minutes, that way I&#8217;m always making some kind of progress, and it keeps you in the habit of doing something so that when you are motivated you get loads done.</p>
<p>When I&#8217;ve lost motivation on commercial work I break work down into stupidly small steps &#8211; import assets, add method to class, email project manager, etc. That keeps the momentum going and keeps the big picture hidden away from view, which is sometimes what you want.</p>
<p>Flow is a subject every game developer should familiarise themselves with &#8211; it has so much relevance to us as it&#8217;s crucial to great game design, as well as it is for getting the job done.†<a href="http://en.wikipedia.org/wiki/Flow_(psychology)" target="_blank">http://en.wikipedia.org/wiki/Flow_(psychology)</a> I rarely find myself in that state as a developer, but I do occasionally have good days, and time really does fly by when you&#8217;re in that state of mind.&#8221;<a href="http://en.wikipedia.org/wiki/Flow_%28psychology%29" target="_blank"></a></p>
<h2>Bas / Bits of Bas</h2>
<p><a href="http://www.bitsofbas.com/">http://www.bitsofbas.com/</a></p>
<p><img class="alignleft size-full wp-image-1308" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/cubedroid.jpg" alt="" width="263" height="200" /></p>
<p>&#8220;I&#8217;m on several customer monster projects and I&#8217;m dragging myself from deadline to deadline since the beginning of February, working from 07:00 to 21:00 on weekdays. Weekends maybe 9:00 to 15:00. As you can imagine my motivation is in pretty bad shape and I don&#8217;t even remember what it was that made me think it was a good idea taking on this huge amount of projects.</p>
<p>The three things that keep me sane:</p>
<p>1. My to-do list. Stop myself from thinking and just go do the frigging next point on the list.<br />
2. Knowing there will be a nice amount of &#8220;sure&#8221; money ( instead of sponsor &#8220;maybe&#8221; money ) waiting for me at the end of the ride that will allow me to take a long summer holiday and pave the road to starting my own projects again.<br />
3. Surely when looking back after a couple of months, I will be proud of my creations. Looking at the bright side always helps.</p>
<p>As for my own projects, all these help:</p>
<ul>
<li>Choosing a game-play you REALLY like. That keeps me entertained.</li>
<li>Go for SMALL games if you know your motivation is a liability.</li>
<li>A decent GDD or to-do list. Moving from point to point. Keep yourself in line.</li>
<li>Working in a ( small ) team. When my mate does all the graphics, I can&#8217;t bring myself to saying I don&#8217;t feel like going on any more.</li>
<li>Don&#8217;t start several projects at once. It&#8217;s like a treat for myself; Once I finish this game, I can go on and pick a new one!</li>
</ul>
<p>Sudden drops in motivation might be solved by: Doing an (even worse) chore in the house, snacking, going out for a walk / shopping, posting to a friendly forum.&#8221;</p>
<h2>Olli / Gaming Your Way</h2>
<p><a href="http://www.gamingyourway.com" target="_blank">http://www.gamingyourway.com</a></p>
<p>&#8220;I usually don&#8217;t have to motivate myself there, although, our current in-house project is dragging for 9 month now. It got WAY bigger than first imagined (way better too) The thing that keeps me going on that one: the todo list (<a href="http://producteev.com" target="_blank">producteev.com</a> and astrid/android) AND the knowledge that it&#8217;ll be done more or less soon.</p>
<p>On personal projects it&#8217;s a different matter &#8230;</p>
<p>I&#8217;m working on two things right now: crystalis and the quite complex hellstrom.†On both games it&#8217;s the todo list (see above) and the fact that I enjoy working with c#/Unity/3d. The one thing that distracts me is my wife, though. Otherwise I&#8217;d be working more on the games.<br />
She constantly tells me that if I feel that I need to work on my games more I can do it &#8211; but as girls are there is a certain &#8220;but you better don&#8217;t&#8221; attached to it. Luckily she&#8217;s the manager of a venue and does at least one night shift per week.&#8221;</p>
<p><strong>Editors Note:</strong> Olli touches on a real issue here &#8211; that of family life getting &#8220;in the way&#8221; and the real feeling of guilt that devs endure when they are desperate to &#8220;escape&#8221; and just geek-out for a while. There&#8217;s no denying that we love our families, and enjoy spending time with our wives and children. But for most geeks I know there is a real need to get away from it all, even for a short period of time, and create or do something constructive on their computer. This is worthy of a whole article in itself.</p>
<h2>Julian / LongAnimals</h2>
<p><a href="http://www.longanimalsgames.com" target="_blank">http://www.longanimalsgames.com</a></p>
<p>1) Think of the money, and how crap your old age will be if you don&#8217;t save up.</p>
<p>2) Don&#8217;t take too long over a project.</p>
<h2>Iain Lobb</h2>
<p><a href="http://www.iainlobb.com/">http://www.iainlobb.com/</a></p>
<p>&#8220;If you&#8217;re not feeling the project, the best thing to do is just break it down into micro-tasks and tick them off one by one. At this level it&#8217;s pretty brainless so I&#8217;ll sometimes stick on a DVD or podcast while I work on client stuff. For personal / indie projects, the best thing for me seems to be to have a very small scope at the start. Scope will obviously grow/creep as the project develops, but at least by starting small you aren&#8217;t setting yourself up for failure. The other really important thing for all projects is to have the artwork first. This gives me a much better vision of the finished product and keeps me motivated to keep working. If you&#8217;re developing with grey boxes it can make it seem like finishing is impossible.&#8221;</p>
<h2>Squize / Gaming Your Way</h2>
<p><a href="http://www.gamingyourway.com" target="_blank">http://www.gamingyourway.com</a></p>
<p><img class="alignleft size-full wp-image-1310" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/dn8.jpg" alt="" width="300" height="215" /></p>
<p>&#8220;Picking a game I&#8217;m panting to play. Very rarely I&#8217;ve pandered to what I thought the market would want, and those games have become such a slog because they&#8217;re not always a game I&#8217;m really into. If I&#8217;m writing a game for myself, which is what personal projects should be, then it&#8217;s because I really want to play that game.</p>
<p>Split the boring stuff up. There&#8217;s always some parts of every project which are just donkey work no matter how fun working on the overall game is. If I know I&#8217;m going to spend a day doing something which makes me die a little inside, I budget the next day to do something fun, usually eye-candy related ( This why I often hear &#8220;You&#8217;ve put particles in there ? But, but the game doesn&#8217;t work&#8221; )</p>
<p>Personal pride. This may seem a little trite, but it&#8217;s very valid. We&#8217;ve worked so hard to ensure that our games are of a certain standard, that we&#8217;re perceived a certain way, that we try and maintain those levels even if it means re-doing things to match our own expectations and no one else&#8217;s. We&#8217;re our own worse critics, and this is why we&#8217;ve only done one &#8220;Game in a day&#8221; as we just can&#8217;t add the levels of love we want in that time scale (Obviously there is always a compromise, but if your expectations are high you compromise less ).</p>
<p>Getting others on board. If you want to give up smoking, or lose some weight, you tell people so you can&#8217;t back out without looking like a dick. The same applies with games, show people stuff early and often and it removes the chance of it becoming vapourware as you really don&#8217;t want to look bad after giving it large.</p>
<p>For me working on only one project at a time helps so much. It brings focus to it, and it stops a cross pollination of ideas between projects which always leads to feature creep (I&#8217;ve just added something sweet to game A, hang on, that could work in game B if I just alter&#8230; ).</p>
<p>The hidden bonus to this is that during the vinegar strokes of a project you&#8217;ve got a brand new one to look forward to, rather than having more slog / donkey work on another one (You forget about all that at the start of a project, if you didn&#8217;t you wouldn&#8217;t make games. It&#8217;s like forgetting just how painful child birth is).</p>
<p>For client games it&#8217;s slightly different, there for me it&#8217;s about making the client love our work. It&#8217;s not for the re-hire, that&#8217;s never really appealed, it&#8217;s about making the client feel good about themselves for picking the right team, that we&#8217;ve hit the project and hit it hard. This is how we roll, this is what you get when you go gyw. That and obviously the silly money.&#8221;</p>
<p><strong>Editors note:</strong> Pure Shakespeare Squize, pure Shakespeare.</p>
<h2>Ali / Alillm.com</h2>
<p><a href="http://www.alillm.com/">http://www.alillm.com</a></p>
<p><img class="alignleft size-full wp-image-1311" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/blueknight.png" alt="" width="104" height="104" /></p>
<p>&#8220;I actually find that when I get bored of a project and want to start something else, it&#8217;s best to just give in and start the new project. If I don&#8217;t, I will constantly have it on my mind and I won&#8217;t get anywhere with the original project anyway. After a few days of working on the new project, my enthusiasm for it will have worn off a bit and it&#8217;s much easier to convince myself that finishing the original project is the best use of my time.</p>
<p>A positive side effect is that once I&#8217;ve finished the original project, I already have a good foundation for my next game waiting for me so I don&#8217;t have to start with a blank canvas.</p>
<p>Also, to-do lists are of course a big help, especially in the final stages where it&#8217;s just a case of adding all of the boring bits.&#8221;</p>
<h2>Chris Houston / Utinni Games</h2>
<p><a href="http://www.utinnigames.com/">http://www.utinnigames.com</a></p>
<p>&#8220;I find a useful thing with todo lists is at the end of the day you can look down and go &#8220;great, I&#8217;ve done those bits&#8221; and tick them off. You get to see what progress you&#8217;ve made, where often if you&#8217;re head-down in a big project it it starts to feel like it&#8217;s not going anywhere.</p>
<p>These days I usually have two lists, a &#8220;headlines&#8221; list and a &#8220;bugs&#8221; list. The headlines are the &#8220;Add Baddies&#8221; kinda things, while the bugs are the little nasties that crop up along the way. When the bugs list gets longer than the headlines, I do them all before going back to the nice bits.</p>
<p>Something else I&#8217;ve realised recently is that all project have their ups and downs. The fun bits and the boring bits, the parts that motivate you to work till the early morning, and the bits where you can&#8217;t be arsed to even look at it. But giving up or abandoning projects at the low parts mean you don&#8217;t get to the next good bit.&#8221;</p>
<h2>Chris Underwood / Deeperbeige</h2>
<p><a href="http://deeperbeige.com/">http://deeperbeige.com</a></p>
<p><img class="alignleft size-full wp-image-1312" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/homesheephome.jpg" alt="" width="346" height="259" /></p>
<p>&#8220;Motivation on contract stuff is pretty much never a problem for me. I can turn down projects I don&#8217;t like the sound of much, so I&#8217;m likely to be at least a bit interested in it. There&#8217;s a pot of cash waiting at the end, and people checking up on your progress all the time. That sounds cold and cynical, but it&#8217;s not. I&#8217;m motivated to give my clients the best value I can for their dosh, and I never want to build bad games (although sometimes I do &#8211; and why is another lengthy subject).</p>
<p>Private games are a different matter. With no externally enforced deadline, nobody harassing you to get it done, and with the latest blockbuster games installed on the work machine too, it&#8217;s all too easy to wander. The best defence I&#8217;ve found is brain-momentum. If you can get in that state of flow where you do pure work and don&#8217;t even notice the time go by, you&#8217;re on a winner. The hard part is getting there, but all you have to do is try hard a lot. It&#8217;s like getting a big heavy boulder rolling. It takes a lot of effort to get moving, but when it does it&#8217;s unstoppable. The trick for me is to muster enough willpower to force myself to do the hard slog bit at the start. I just have to force myself to get on with it.</p>
<p>Sometimes I&#8217;ll need to clear down other stuff first, or it&#8217;ll keep knocking me out of the zone. Get those important emails sent. Make up those invoices. Do the washing up. Watch the latest episode of Mythbusters and complete that latest game. Then be ruthless. Then get on with it. No excuses. No breaks. Open Flash and do at least an hour of gazing at code or tweaking level designs or something. Doesn&#8217;t really matter what in terms of getting momentum going, so pick something easy and fun. Once you&#8217;ve got brain-momentum going, the rest just falls into place automatically.&#8221;</p>
<h2>Dave Munsie / Munsie Games</h2>
<p><a href="http://munsiegames.com/">http://munsiegames.com</a></p>
<p>&#8220;I used to have severe motivation (a.d.d?) problems. Like most people I learned to take things in much smaller steps. Otherwise I really don&#8217;t have any motivation problems, because if I don&#8217;t work&#8230; I don&#8217;t make money. :)&#8221;</p>
<h2>Tony / Tonypa</h2>
<p><a href="http://www.tonypa.pri.ee/">http://www.tonypa.pri.ee</a></p>
<p><img class="alignleft size-full wp-image-1313" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/jorinapeka.jpg" alt="" width="260" height="207" /></p>
<p>&#8220;I don&#8217;t do contract work so it only leaves the games I make because making games is fun. Since there is no money involved, only fun-part, I stop the project as soon it is not fun anymore. Which happens a lot. Over the years I would say I only finish 1 out of 10 games.</p>
<p>I don&#8217;t even enjoy coding too much. Most fun is to imagine how something could work, usually at half-sleep. Sitting down and writing the code for it to work is interesting only as far it improves or changes the first idea. Something went wrong in the code but it creates new and interesting gameplay &#8211; scrap the original idea and go for this instead. For me making games is a lot like painting or writing novel, its a creative process where you have some vague idea about what you would like to create but process itself is the main reason to do it.</p>
<p>One thing I have noticed is to never start on graphics too early. If the game is not fun using only boxes and circles then it will not be fun with robots-zombie-vampires either. So I tend to stick with boxes and circles for a very long time, sometimes getting used to those so much that I never bother putting proper graphics into game :)&#8221;</p>
<h2>Rob James / robotJAM</h2>
<p><a href="http://www.robotjam.com/">http://www.robotjam.com</a></p>
<p><img class="alignleft size-full wp-image-1314" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/zombooka2.jpg" alt="" width="160" height="120" /></p>
<p>&#8220;I think it really helps on projects working fulltime with another person, me and the other guys generally spend most of the time kicking each other into getting stuff done, and on non contract jobs there&#8217;s the added motivation the faster you get it done the more profitable it is.</p>
<p>I always find I hate the first few days of a project, but I know that after that we&#8217;ll have a decent prototype done and the middle part of the project is always the best. Its the end which I really hate as you think its done and it always takes a while to finally kill them off.</p>
<p>We generally move onto lists in the last week of a project and just knock them off one at a time.&#8221;</p>
<h2>Ilija Melentijevic / Photon Storm</h2>
<p><a href="http://ilkke.blogspot.com/">http://ilkke.blogspot.com</a></p>
<p><img class="alignleft size-full wp-image-1315" style="border: 0px;" src="http://www.photonstorm.com/wp-content/uploads/2011/05/shaman.png" alt="" width="200" height="226" /></p>
<p>&#8220;I use lots of methods to tackle lots of related problems, so I&#8217;ll just spill it all, and you try and make sense of it. A long time ago I too had trouble with starting things. Typical procrastination stuff, you do nothing for so long and then you feel like you have to do something epic to make up for it, and that only makes it harder, etc.</p>
<p>For me the trick was to just start doing anything. Not do it for the sake of completing it but for the sake of enjoying the process. I would just take a pen and draw something and it wouldn&#8217;t matter if it was good or bad. The point was to remember why I love doing it in the first place. We all sort of chose to do what we like to do, and when you forget that, you have to shed the things that make it not fun anymore and start over.</p>
<p>Another trick is to deliberately do things slowly. It helps separate the process from the goal, which in turn helps me to not be impatient and wish I&#8217;ve already completed something. I also employ this tactic when I have to wash the dishes or similar. I just start doing it and after a while it&#8217;s magically done.</p>
<p>All in all this would boil down to &#8216;making time stop&#8217; for lack of a better description. I find that going to the office every day and clicking on thousands of links people send me each day makes me lose the grip on my time, and then I try to just stop and sort of be in the moment, in the &#8216;now&#8217;. It&#8217;s like there&#8217;s a big noisy machine out there and you can&#8217;t hear your own thoughts because of all the noise it makes.</p>
<p>I do suffer from being used to doing what I&#8217;m passionate about. I think this is very important in life and I don&#8217;t want to regret not doing it later. The drawback is that I start a zillion things and take on a zillion projects and thus lose focus and disintegrate. When I get passionate about the next thing, the thing I&#8217;m working on is of course not finished yet and so I just leave it there. Ultimately the right thing to do.</p>
<p>There are however times when I&#8217;m not in love with any project in particular and this is the time I use for making progress on the things that I&#8217;ve left hanging. I make lists, I put files and folders out on the desktop to remind me of their existence. It also helps to to a tiny bit of work done whenever you have a little bit of time. These fragments add up very quickly.</p>
<p>Sometimes I just think about the amount of work I do when I&#8217;m being paid for it (full time or freelance), and think about how I should be able to work for myself even better. I tell myself it&#8217;s humiliating to not be able to get myself to do things that I feel are the only ones really worth doing.</p>
<p>Also, here&#8217;s something a friend once told me: &#8220;In a few years time, nobody will know how easy or hard it was for you, if you were tired, or ill or if somebody close to you had passed away. All that is left is what you&#8217;ve done.&#8221;</p>
<p>The trick for me is to have mantras such as these, thoughts that snap me out of the everyday slipstream and remind me how each day is special, how I am special (since we are all different, thus special :D) and that I should be doing things that only I can do instead of wasting time on the net or in front of the TV, or *shudder* watching series. Or playing games that are not the absolute best games I&#8217;ve ever played. Of course, one has to unwind now and then, but we usually end up being too lax on ourselves instead the other way around.</p>
<p>Let me try to wrap up this chaotic rant with something practical: I find it helps to keep track of what I&#8217;ve already done, it makes me feel powerful and thus less prone to procrastination. Even a very simple method like <a href="http://en.wikipedia.org/wiki/Pomodoro_Technique" target="_blank">Pomodoro Technique</a> does wonders&#8221;</p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; Photon Storm for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/flash-game-developer-tips-9-by-photon-storm">Permalink</a> |
	  <a href="http://mochiland.com/articles/flash-game-developer-tips-9-by-photon-storm#comments">9 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/flash-game-developer-tips-9-by-photon-storm&amp;title=Flash Game Developer Tips #9 by Photon Storm">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/flash-game-developer-tips-9-by-photon-storm" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/front-page" title="View all posts in Front Page" rel="category tag">Front Page</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland" title="View all posts in MochiLand Topics" rel="category tag">MochiLand Topics</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/flash-game-developer-tips-9-by-photon-storm/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Announcing Mochi Achievements!</title>
		<link>http://mochiland.com/articles/announcing-mochi-achievements</link>
		<comments>http://mochiland.com/articles/announcing-mochi-achievements#comments</comments>
		<pubDate>Tue, 14 Jun 2011 13:00:08 +0000</pubDate>
		<dc:creator>Colin Cupp</dc:creator>
				<category><![CDATA[Developer Feed]]></category>
		<category><![CDATA[Flash Development]]></category>
		<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Game Design]]></category>
		<category><![CDATA[Games Industry]]></category>
		<category><![CDATA[Industry News]]></category>
		<category><![CDATA[Mochi Media Announcements]]></category>
		<category><![CDATA[arcade]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Mochi Media]]></category>
		<category><![CDATA[publisher]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://mochiland.com/?p=5032</guid>
		<description><![CDATA[I am happy to announce the official release of the new Mochi Achievements API! Mochi Achievements API Summary Flash game developers can now implement a completely customizable achievements system in your games that is free, flexible, and easy to use. The Mochi Achievements API also gives developers the flexibility of 2 toaster sizes (toaster = [...]]]></description>
			<content:encoded><![CDATA[ <p><a href="http://www.mochimedia.com/developers/achievements.html"><img class="alignleft size-full wp-image-5086" style="border: 0px" title="achievement_API" src="http://mochiland.com/wp-content/uploads/2011/06/achievement_API.png" alt="" width="624" height="165" /></a></p>
<p><strong>I am happy to announce the official release of the new <a href="https://www.mochimedia.com/developers/achievements.html">Mochi Achievements API</a>!</strong></p>
<h1>Mochi Achievements API Summary</h1>
<p>Flash game developers can now implement a completely customizable achievements system in your games that is free, flexible, and easy to use. The Mochi Achievements API also gives developers the flexibility of 2 toaster sizes (toaster = achievements pop-up) and 9 toaster placement options so that your achievements system looks and feels the way you want it to.</p>
<p>Speaking of look and feel, there is no Mochi Media branding in the default UI, and we encourage developers to implement your own UI (using the Mochi Achievements calls) for a more seamless game integration. The default UI comes with an achievements list, toasters, and graphics for the locked and unlocked states of your achievements (but you can easily customize the &#8220;unlocked state&#8221; graphics in the default UI).</p>
<p>We have also included a points system (points related to the achievements, developer-determined) complete with progress bars. Your players can view their points and achievements progress as they&#8217;re earned/unlocked.</p>
<h2>Who Should Use Mochi Achievements?</h2>
<h4>Developers:</h4>
<ul>
<li>If you don’t have the time or desire to create your own achievements system, but would love to have a quality solution that gives you control.</li>
<li>If you are looking for a solution you can completely customize, either with your own branding or even a sponsor’s branding- you can be as creative as you want to be.</li>
</ul>
<h4>Publishers:</h4>
<ul>
<li>Take advantage of the <a href="https://www.mochimedia.com/publishers/custom-integration.html">Mochi Publisher Bridge</a> for site-specific achievements, getting more value out of your community and your players.</li>
<li>You can request that developers implement Mochi Achievements with your branding for sponsorships and site-locks.</li>
</ul>
<h2>Mochi Achievements Examples</h2>
<p><a href="http://www.mochimedia.com/games/play/flying-candy/">Flying Candy</a>, <a href="http://www.mochimedia.com/games/play/papas-taco-mia/">Papa&#8217;s Taco Mia!</a>, <a href="http://www.mochimedia.com/games/play/big-little-plagiary-3-made-in-china/">big LITTLE plagiary 3</a>, and <a href="http://www.mochimedia.com/games/play/flood-runner-3/">Flood Runner 3</a> are all examples of games that are using Mochi Achievements in different ways to &#8220;achieve&#8221; the same goal. Check out the two example games below to see the contrast between the default UI and what can be done with a custom UI.</p>
<p>The first example is <a href="http://www.mochimedia.com/games/play/big-little-plagiary-3-made-in-china/">big LITTLE plagiary 3</a>, which uses the default UI. The second game is <a href="http://www.mochigames.com/game/papas-taco-mia/" target="_blank">Papa&#8217;s Taco Mia</a>, which is using custom UI created by the developer along with the Mochi Achievements calls. Note that the default UI has no branding, while the customized UI can be made to look however you want it to (including sponsor branding).</p>
<h4>big LITTLE plagiary 3 Achievements List (default UI)</h4>
<p><img style="border: 0px;" title="big LITTLE plagiary Achievements List" src="http://i.imgur.com/d4pkq.png" alt="big LITTLE plagiary Achievements List" /></p>
<p>&nbsp;</p>
<h4>big LITTLE plagiary 3: Achievement Unlocked (default UI)</h4>
<p><img style="border: 0px;" title="big LITTLE plagiary Achievement Unlocked" src="http://i.imgur.com/SQSRo.png" alt="big LITTLE plagiary: Achievement Unlocked" /></p>
<p>&nbsp;</p>
<h4>Papa’s Taco Mia: Achievement Unlocked (developer customized UI)</h4>
<p><a href="https://www.mochimedia.com/developers/achievements.html"><img style="border: 0px;" title="Papa's Taco Mia Achievement: Tomato Time" src="http://i.imgur.com/d8lbN.jpg" alt="alt text" width="648" height="474" /></a></p>
<p>&nbsp;</p>
<h4>Papa&#8217;s Taco Mia: Achievements List (developer customized UI)</h4>
<p><a href="https://www.mochimedia.com/developers/achievements.html"><img style="border: 0px;" title="Papa's Taco Mia Achievements List" src="http://i.imgur.com/GJhqx.jpg" alt="alt text" width="644" height="384" /></a><br />
<strong> </strong></p>
<h2>What Makes A Good Achievement?</h2>
<p>Most game creators would agree that achievements make games more engaging and encourage players to stick around (increase replays). But how do you know if you are making a good achievements system? Here are a few resources we thought were interesting on the subject:</p>
<ul>
<li><a href="http://www.escapistmagazine.com/videos/view/extra-credits/2758-Achievements" target="_blank">Extra Credits</a></li>
<li><a href="http://www.gamasutra.com/view/feature/6360/the_cake_is_not_a_lie_how_to_.php" target="_blank">The Cake is not a lie, pt.1</a></li>
<li><a href="http://www.gamasutra.com/blogs/GregMcClanahan/20091202/3709/Achievement_Design_101.php">Achievements 101 by Greg McClanahan</a></li>
</ul>
<h2>Want to try it out? Here’s how!</h2>
<ol>
<li><a href="http://www.mochimedia.com/dl/MochiAPI_v3_9_3.zip" target="_blank">Download the latest version of the Mochi API</a></li>
<li>Once you have the latest API, log in to your developer dashboard</li>
<li>Select the game to which you would like to add achievements</li>
<li>Select “Achievements” in the left-hand menu</li>
<li>You should now see the information to create and edit achievements.</li>
</ol>
<p>This new tool is a direct result of the community giving us product feedback- you wanted it, we thought it made sense, so we made it. Let us know what other products and features you would like us to work on by visiting our <a href="http://mochimedia.uservoice.com/forums/86073-mochi-product-and-services-feedback*" target="_blank">product feedback forums</a>.</p>
<p><strong>Be sure to let us know what you think about Mochi Achievements- we want your feedback! :)</strong></p>
 <div class='series_toc'></div>	<p></p>
	<hr noshade style="margin:0;height:1px" />
	<p>&copy; Colin Cupp for <a href="http://mochiland.com">MochiLand</a>, 2011. |
	  <a href="http://mochiland.com/articles/announcing-mochi-achievements">Permalink</a> |
	  <a href="http://mochiland.com/articles/announcing-mochi-achievements#comments">5 comments</a></p>
	<p>Add to <a href="http://del.icio.us/post?url=http://mochiland.com/articles/announcing-mochi-achievements&amp;title=Announcing Mochi Achievements!">del.icio.us</a></p>
	<p>Search blogs linking this post with <a href="http://www.technorati.com/search/http://mochiland.com/articles/announcing-mochi-achievements" title="Search on Technorati">Technorati</a></p>
	<p>Want more on these topics ? Browse the archive of posts filed under <a href="http://mochiland.com/category/mochiland/developer-feed" title="View all posts in Developer Feed" rel="category tag">Developer Feed</a>, <a href="http://mochiland.com/category/mochiland/flash" title="View all posts in Flash Development" rel="category tag">Flash Development</a>, <a href="http://mochiland.com/category/mochiland/front-page" title="View all posts in Front Page" rel="category tag">Front Page</a>, <a href="http://mochiland.com/category/mochiland/game-design" title="View all posts in Game Design" rel="category tag">Game Design</a>, <a href="http://mochiland.com/category/mochiland/games-industry" title="View all posts in Games Industry" rel="category tag">Games Industry</a>, <a href="http://mochiland.com/category/mochiland/gaming-news" title="View all posts in Industry News" rel="category tag">Industry News</a>, <a href="http://mochiland.com/category/mochiland/mochi-media-announcements" title="View all posts in Mochi Media Announcements" rel="category tag">Mochi Media Announcements</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mochiland.com/articles/announcing-mochi-achievements/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

