Setup

Download the lab files. You are provided with all the files correctly setup as needed. Take some time to look at lab13.fla to see how it is setup ( the linkage on the items in the library, the FPS, and the document class ).

Open up gameMain.as to fill in the new code ( defined within "//new" and "// /new" comments within the finished code ).

The game class

You will be adding new variables for enemies and bullets, and updating those respectively. In addition, you will add scrolling to make this a true sidescroller

Enemies

The enemies code will be created in a seperate folder. You will have to create a file badMan.as in the folder "/src/enemies" for the code to work. In addition, the package will have to be "package src.enemies" to compile correctly. This will help you clean your code up immensely in future actionscripting.

The enemy has simple ai defined by a switch statement, and some chase code that works by checking the distance between enemy and player.

Bullets

Bullets fly straight in this example, but gravity can be applied to it rather simply. Care must be taken not to allow too many bullets on the stage. While flash can handle quite a bit in actionscript 3.0, each bullet is checking if it is hitting each enemy; with a number of both on the stage, it can get computationally itensive quickly.

Final assignment

With the enemies, bullets, and scrolling working, do two things:

Group work is allowed for this final assignment.