Ononmin Flash prototype – step 2

I added some features to the Ononmin Flash prototype I showed you some days ago.

Now the mushroom moves along the x axis in a field with a customizable number of bad circles and can fire a bullet. At the moment the bullet keeps on flying until it reaches stage’s edges, then it’s removed and the mushroom can shoot another bullet.

In order to keep classes and variables well organized, I changed some class names. These are the new classes/objects:

ball_mc: the rotating cannon

bullet_mc: the bullet fired by the cannon

field_mc: the battlefield

madball_mc: the spheres your bullet can’t touch

mushroom_mc: the moving mushroom

onon_mc: the game itself

The main class is obviously onon.as that simply creates a battlefield:

field_mc.as manages the circles you cannot touch, the mushroom and the firing routine

So madball_mc.as just places and scales the circle you can’t touch in a random way

Then mushroom_mc.as manages mushroom movement and adds the cannon

ball_mc.as manages the rotating cannon

Finally bullet_mc.as manages the fired bullet

Nothing difficult but it’s good to see every objects working in its own class

This is the result:

Press the mouse to fire the bullet, you cannot fire again until the bullet flies off the stage

Download the source code.

Next time, collision detection.

  • i can see the basis of a game coming about now :)