CS2 Project 5: Graphics and Events
Due: Tuesday May 4th at 11:59pm (this is reading day).
Edited 4/20/2010 Added extra credit and fixed typo in due date.
You will build a simplfied version of the old (or shall we say
"classic") Arcade game sometimes called Galaga and sometimes Galaxian.
(there were subtile differences but they were essientually the same
For those of you who haven't seen the refresh on a portable game device the game looks something like the one below:
Players control a ship which is at the bottom of the screen. Players
can only move the screen horizontally back and forth. The ship can fire
some sort of shot at the enemies at the top of the screen.
The enemies will move back and forth horizontally while staying within
their rows. Occasionally one of them will fire down the screen in hopes
of hitting the players ship. Once in a while on of the attacking
enemies will break formation and dive down the screen as well.
In your project you will write a simple one level galaga clone.
- You need a player ship at the bottom of the screen.
- The player ship needs to be able to fire (you can use a mouse button or a key for this)
- The player ship needs to be able to move left and right (use mousemovement or a key for this)
- You need three types of enemy ship
- each row of enemies should be full of a different enemy type.
- Occasionally one of the enemy ships should fire at the player.
- an easy way to do this is to set a low probability of firing, then
at each update, select a random number and if it is within that low
probability, then fire, else do nothing at that timestep.
- The enemy ships should be destroyed when hit by the player fire.
- each type of enemy should be worth a different amount of points.
- You need to keep score.
- this could be shown to the user anywhere.
- If the player kills all of the enemy ships the player wins
- you need to stop the game at this point and announce the win
- the player should start out with 3 "lives"
- you can show the player this by whatever means is convenient
- you could show the player via text, via a number of extra
ship icons (as in the original game) or in whatever other means make
I have made a set of images available to you. Refer to class discussion for location.
I'll also recommend some starting points and progression in completing this project in class.
Extra credit is available for this project for those who have finished
the above required parts of the project. (if enough of the actual
project is not finished, you will not be eligable to be graded for the
extra credit) This final project will be worth 200+ points (making your
55 point first project small potatoes in comparison). This will give
you a feel for how the extra credit is weighted. You may do any, all or
none of the extra credit options below. Be sure to tell me if you did
do any so you can get credit for them.
- Add sound effects (20pts) add a different sound for each of the following:
- when firing,
- when an enemy or player ship gets killed
- When the player wins
- When the player loses
- Add a kamakaze enemy (15pts)
- occasionally, one of the enemies tries to dive bomb the player.
- Add an extra "life" bonus (15pts)
- Add a mechanism to gain an extra life - either through score or
as a special enemy. Be sure to inform the user graphically or via audio
(if you did part 1 above) about the extra life.
I am placing the following restrictions on you to encourage you to practice good software design.
- You must comment your code, each method at least must contain a
comment describing what the method does. If the method is more
complecated, additional methods are appropriate.
- No method may be more than 30 lines long
- No single class can be more than 200 lines long.
When your program is ready, you need to write a readme.txt file
that provides me the following information:
The name of your java files (and
the names of any extra non-public classes that are contained in the
The implementation decisions that
you made. Why did you solve the problem the way that you did?
Directions on running and using
your program. How do I fire? How do I move the ship? How do I know how many lives I have? eetc.
And any problems or bugs left in your program. If your
program doesn't quite work in some situations, tell me about it. If
your program doesn't run or compile, I want to know that before I
- If you tried for any extra credit, let me know that as well.
When your readme and your code is ready, zip up your files and submit them online as you have done for the other labs