Asteroids Assignment

Table of Contents

The files needed for this assignment can be downloaded from MrZ/ When you first run the version of your project that you are given, you will see a simple black screen, with nothing happening. Your task is to create the asteroids, ship, and lasers, and write the code describing how they interact with each other.

1. The requirements

1.1. Asteroids

You game should have asteroids that appear at the top of the screen and fall toward the bottom of the screen. You may want to make them fall straight down, or you may want to make them go to the side as they fall.

1.2. Your Ship

The player should be able to control, by the keyboard, a ship that moves back and forth at the bottom of the screen. If there is a collision between this ship and an asteroid, the ship is destroyed and the game ends (call Asteroids.gameOver()).

1.3. Lasers

The player can press a key to fire lasers. These travel up the screen. If there is a collision between a laser and an asteroid, both are destroyed.

1.4. Other Optional Extensions

Once you have the basic required functionality of the game written, there are more things you should think about doing. For example, you might want to have the density of asteroids gradually increase. You may want powerups to appear somehow. You may want to make explosions appear when the ship or an asteroid is destroyed. The sample game here shows some of these things working, but you should not try to copy it. Rather, think up how you want the game to play, and write it your own way.

2. Some files you may want to refer to

Sample Applet
Sample Screenshot
Zip file containing JCreator project
Asteroids Animations
Key Code Names

3. Some tasks you may need to accomplish

Instead of trying to present all the information you need for this assignment in some sequential fashion, I've broken it down into what you might need to know in order to do the assignment.
Timeline of a game
Working with the coordinate system
Creating a new GameObject class
Changing a GameObject's behavior
Advanced tinkering with the GameObject class
Starting up the game
Working with the Animation class
Getting keyboard input
Dealing with collisions
Dealing with death
Random numbers and sporadic events
I will be adding more tasks to this list as people tell me what they'd like to know how to do. You can leave a message asking me how to do something by posting a comment on this page. This requires that you create a user account for yourself, or log in as the user "nobody" (Password: nobody).

- - Fri, 9 Dec 2005 15:49:53 -0500
shit shit ass shit hahahahahaha

- - Fri, 9 Dec 2005 15:49:06 -0500
hey this is bullcrap wat the heck are we suppose to do this sucks its boring

- - Thu, 28 Apr 2005 07:46:49 -0400
hi i am on cpu no. 24

- - Thu, 31 Mar 2005 07:39:01 -0500
Hello :)
- - Thu, 24 Mar 2005 07:36:30 -0500
- - Thu, 3 Mar 2005 07:50:45 -0500
i hate poo poo person
- - Thu, 3 Mar 2005 07:47:52 -0500
You are not alone because i love toes too especially with jam wat am i saying wtf?
- - Thu, 3 Mar 2005 07:43:39 -0500
i love toes

- - Wed, 23 Feb 2005 09:58:04 -0500
The purpose of posting comments on the website is to ask questions related to the assignment for which you think other students would be able to answer or would benefit from my answers.