Asteroids Recommended Steps
- Get a small triangle to display in center of screen. This will be your ship.
- In advanceFrame use some method of input (I would say keyboard arrows) to rotate the ship.
- Place some asteroids on the screen. Use an array or ArrayList to store them.
- Make the asteroids move all with same velocity.
- Make the asteroid velocities random.
- Make the asteroids wrap so when they go off one side they come back in from the other.
- Add ability to make the ship move. Hint: Either use a tracker or write the code yourself.
- Make the ship wrap like the asteroids do.
- Add collisions between the ship and asteroids, so you lose when one hits your ship.
- Add the ability to fire bullets from your ship with a keypress or mouse button click. Hint: use an array or ArrayList to store the bullets. It is okay (preferred actually) to have a limited amount of bullets the user can fire at one time.
- Make the bullets disappear when reaching end of screen. Hint: The best way of making one disappear is to move it WAY offscreen and set its tracker to a velocity of zero. If you just set it to invisible collisions with asteroids will still register.
- Make the bullets capable of hitting the asteroids and make both disappear when they do hit.
- When one asteroid is destroyed, make a new one appear elsewhere. Hint: instead of making the asteroid go away like in the previous step, just move it somewhere new and give it a new velocity.
- Add a lives counter so you have more than one ship before game over.
- Add scoring.
- Extras:
- Make large and small asteroids. When a large one is hit it explodes into three smaller ones. If a small one is hit it disappears
- Instead of bullets disappearing at edges, make them wrap around like the asteroids do. Each time a bullet is fired, assign an alarm to it that will make the bullet disappear after some amount of time.