Overall Purpose:

With the world I created, the purpose is with 2 colored types of mice chasing after a piece of cheese. The idea was that the 2 farthest mice, 1 from each color(1 red, 1 blue), would try, and race, to get to the cheese first. What ever mouse didn’t get the cheese frist would change to the opposite color while the winning mouse that did get the cheese first would just go about as normal and not change.


Variables and Usage:


WorldManager class

redMouse:Array;

This is used throughout the program and contains all the mice for the red team

redChaser:MovieClip;

This is set to the farthest mouse in the redMouse array each time a new piece of cheese is placed in the world

redFarthest:Number = 0;

This is used in determining who is the farthest away in the redMouse array and is first set in the setFarthestMouseToCheese function


blueMouse:Array;

This is used throughout the program and contains all the mice for the red team

blueChaser:MovieClip;

This is set to the farthest mouse in the redMouse array each time a new piece of cheese is placed in the world

blueFarthest:Number = 0;

This is used in determining who is the farthest away in the redMouse array and is first set in the setFarthestMouseToCheese function


cheese:MovieClip;

This is used throughout the worldManager and get initialized on the initWorld function so all the mice k

maxCounterLimit;

Is a random value that get initialized on initWorld but then gets set to a new value each time a cheese is placed into the world

currentCounter;

A counter that gets incremented every frame until it reaches the maxCounterLimit and then gets set back to zero

chaseCheese:Boolean;

A Boolean that gets set to true when a cheese is placed into the world and back to false after a mouse ‘eats’ the cheese

getReadyToChase:Boolean;

This gets initialized to false in the beginging but get changed to true when a cheese first enters the world so it can do a little intro animation and back to false after the cheese gets eaten by a mouse

//Mice class

imFarthest:Number = 0;

Gets set to 1 in the worldManager and then a certain part of the code is executed if the mouse is the farthest away from the cheese

mouseWorld:WorldManager;

A reference to the worldManager

dontWantToPlayAnymore:Number = 0;

if the worldManager is sending mice back “home”


Problems Encountered

The biggest problem I found was with the cheese and how the mouse would chase it. At first I had it that the closest to the cheese would run after it but things where moving to fast and it was hard to tell what was going on. An easy solution was to have the farthest chase it. This solved visual problems a little bit. To make things even better I did a little animation for the cheese when it first enters the world. But with that came another problem, when the cheese entered the world the mice would start to run after it and catch it even if the animation was done or not. So, I had to think of a way to have to mouse chase the cheese only after the animation was complete.




Media

The chomp sound and squeak sound were taken from a CD of soundFXs. The background music was borrowed from Chris Catignani and is called Circus of the Cats.