This is Lesson 3 of our four-part series in which I describe in detail how to create a very basic game in Flash. We will be building a very simple shooting game named “Home Computer Wars”, inspired by all my friends who wanted make games in the 80’s, but never succeeded. In this game you will play “Atari” in an attempt to fight off the onslaught from IBM, Apple, Commodore and Texas Instruments computers. We will be coding this game in ActionScript 2. However, we will be using an object oriented messaging system that can, with some effort, be ported to ActionScript 3.
Tutorial Outline:
- Lesson 1: Game Setup - We first learn how to set up our game framework in Flash, and then create a player that can move and fire missiles.
- Lesson 2: Creating Enemies & Game Environment - We add a scoreboard and waves of enemies that gradually get harder and harder to fight.
- Lesson 3: MochiAds, MochiBot, and the MochiAds Leaderboards - We add MochiAds, MochiBot and the MochiAds Leaderboards service
- Lesson 4: Finishing Touches - Balancing And finishing: Level Balancing, Sound fx, Logo Screen
Read on for the lesson…
MochiBot
The first Mochi service we will add to our game is MochiBot. MochiBot is an easy and effective way to track analytics as who has posted your Flash game on their site, and how many times it has been played. Adding MochiBot to your game is quite easy.
The first thing you must do is go to http://www.mochibot.com/register.html and sign-up for an account.

After you have created a new account, login and locate the Create New MochiBot button and click it:

Fill out the information about your game, and click [SAVE]

Now, copy the code that is displayed on the MochiBot Code page:

On the second frame of your movie (we will use the first frame for MochiAds), paste the code that you copied above:

And there you have it, the first Mochi service, MochiBot has been integrated. Now we can use MochiBot to track where our .swf file all across the internet. Pretty cool huh?
>> Click to page 2 below to continue reading.
Read the rest of the series: ‘Anatomy of a Flash Game’
- Anatomy of a Flash Game: Lesson 1 - Setting up the game
- Anatomy of a Flash Game: Lesson 2 - Creating Enemies & The Game Environment
- Anatomy of a Flash Game: Lesson 3 - MochiAds, MochiBot and MochiAds Leaderboards

Is Actionscript 3.0 supported by any of the Mochi products ?
- Kenneth C
Yes, both MochiBot and MochiAds support AS3.