You are going to create a space invaders game. You will be given some working objects that interact in a universe, and you will need to figure out how to inherit from these objects in order to create the game.
You will write a program that draws at least 8 spaceships on the screen and moves them back and forth across the window. These spaceships should drop bombs randomly. The bombs should destroy the hero if they hit him. The hero is controlled by your mouse and resides at the bottom of the screen. The hero can shoot missiles that will destroy spaceships when they hit them. Your spaceships should inherit from the class SpaceThing and override any behaviors that they need to to implement the game. You should inherit from your spaceship class to create at least two other kinds spaceships that change size or disappear and reappear.
Your program should have:
Plan out your class hierarchy. Which classes will inherit from which other classes? What instance variables will you need to implement new behaviors? What new methods will you need to implement the new behaviors?
Start with the basic asteroids working code and gradually add new objects to the game.
Once you have a spaceship, get it to drop bombs and make sure they interact with the hero correctly.
Then get the hero to stick to the bottom of the screen and fire missiles correctly.
Finally, add additional spaceship behaviors.
You will need to use the ACM library, so you may want review the tutorial on using the ACM library.
Again, take a look at the examples.
We require that you use a separate .java file for all of your classes for this project. The SpaceThing object you inherit from will have a instance variable that references the universe to allow you to add things to the canvas.
The Space example starts you off with a lot of valuable code for this project. If you understand how all of the code for that example works, then you should be able to complete this project with relative ease. If you do not understand how that code works, then you should study it, change it, and work with it until you do. TAs can help explain it to you, but it is best if you first make an effort to understand it for yourself. If you do not understand the code that you are working with, you will shoot yourself in the foot over and over. Please, please, understand the code.
You can download a zip file containing a project with the working Space example at (http://dna.cs.byu.edu/cs142/AsteroidsStudent.zip). In order to load it into Eclipse, go to File/Import/General/Existing Projects into Workspace/Select Archive File/Browse. Select the zip file (Eclipse will unzip it for you). It should cleanly import a project named Asteroids.
When you have your program working, you will need to show it to a TA. The TA will evaluate your code based on the following criteria:
5 points extra credit: Do something creative that really impresses the TA.
Extra Credit: Pass off early (1 point per day (excluding Sunday) up to 3 points)