In this project, you will make your own version of the famous arcade game Asteroids! For
a history of the game, see
the
wikipedia article and to try playing the game online, visit
http://www.play.vg/games/4-Asteroids.html.
Starting code:
my_starter_code.zip
Overview:
asteroid.pdf (by Dan Leyzberg and Art Simon, the original authors of this assignment)
For part 1 (due on Blackboard by Thurs. April 24 at 11:59pm):
- Write code that creates the spaceship and displays it on the screen.
- Write code so that the user can make the ship move forward and turn by pressing
keys on the keyboards. You do not need to implement acceleration (i.e. the ship can
move at a constant speed).
- Write code to create asteroids, making them appear and move on the screen. At this
point, the asteroids can just move at a constant speed in the same direction.
- Write code to check if there has been a collision between the spaceship and an asteroid.
For part 2 (due on Blackboard by Thurs. May 15 at 11:59pm):
- Write code to make the spaceship to fire a bullet when the user presses some key.
- Write code to add some stars in the background.
- Write code to check for intersections between any bullets and asteroids. The asteroid
can disappear if there is a hit.
- Add two other features to your program. Some possibilities are below.
Possible features to add to your game (but feel free to come up with your own improvements):
- Make the spaceship accelerate when the user holds the 'forward' key, instead of just
moving at a constant speed.
- Make the large asteroids split into smaller asteroids when they are hit.
- Add a timer, and end the game if the player fails to destroy all the asteroids before
the time runs out.
- Keep score.
Grading: each part of the project is worth 100 points. Up to 5 extra credit points will be given
for the final project for additional features beyond the required ones.
Hints
- A list of keycodes is
here. In particular, the keycode for a lower case letter is the unicode, the keycode
for the up arrow is VK_UP, the keycode for the left arrow is VK_LEFT, the keycode for the
right arrow is VK_RIGHT, and the keycode for the spacebar is VK_SPACE.