Wait, Click on Game, Press S.

  S start game.
  Left/Right Arrows rotate.
  Up/Down Arrows thrust.
  Spacebar fire.

  B black or white.
  C collide.
  D details.
  G godmode .
  H hyperspace jump.
  M mute sound.
  P pause game.
  R round or square.
  W wrap or bounce.

Wait a minute or three while the files load.  Game is ready when it says "Ready to Start New Game." To Play:  FIRST CLICK ON THE GAME AREA . . . and then press S.
Main Controls.
S
starts game.
Left/Right Arrows rotate the ship.  (Hold down for continuous rotation.)
Spacebar fires the ship's cannon. (Hold down for continous shooting.  
      If the max number of bullets are active, firing again removes the oldest bullet).
H jumps ship through hyperspace to a new location and makes it temporarily invulnerable.

Other Controls.

Up/Down Arrows thrust the ship forward and backwards (use sparingly).
B toggles between a (default) black background and a white background.
C toggles the collision feature of having the asteroids bounce off each other.
G toggles on a "Godmode" which makes your ship invulnerable.
D toggles graphics detail (asteroid fill and stars).
M toggles sound muting.
P pauses game.
R toggles between round world and square world.
W toggles between the (default) screenwrap mode and a bouncing-off-the-edges mode.
How To Play the Game.

Click on the game area and press S. Rotate ship with Left/Right arrow keys, shoot with the spacebar.  Generally Up/Down key thrusting is a mistake as then you lose control of the ship.

You can hold the rotate and shoot keys down for continous rotation or shooting.  If you do both at the same time, you'll see a little "whip" of bullets coming out of your ship, but the whip is of a fixed length as the oldest bullet keeps being replaced by the newest bullet.  Release the spacebar now and then to send a flock of bullets out towards the asteroids.

The asteroids run away from the bullets.  They only "see" bullets that are currently getting closer to them, also the bullets have to be within a half-screen distance.  The asteroids don't "see" around the wrap.  The asteroids bounce off each other.  It's hard to shoot the last asteroid or two.  You need to wait till it ventures close to you and then blast it.  Or you can "corner" it by turning off the wrap.

The biggest threat is the UFOs and their missiles.  As you reach higher score levels, a UFO will be born and make a number of passes across the screen, firing a missile at you each time.  The missiles guide themselves towards you, so it's hard to run away from them.  There are two ways to handle a missile: (1) Press H for hyperspace, and the missile will miss you.   In the current implementation there is no limit on the number of times you can use H.  (2) Or brace yourself and aim very carefully at the missile and shoot it.  They're hard to hit because they're small, but it can be done. In either case, if you have a second to think you should try and shoot the UFO before it fires another missile.

The Asteroids Alive Applet

Asteroids Alive is based on an Asteroids Java applet written by Mike Hall.  The presently revised form is copyright (c) Mike Hall 1998 and copyright (c) Rudy Rucker 1999.  See the License Agreement on Mike Hall's Asteroids for further information.  The orignal applet is running there, and you can dowload Mike Hall's source and executable from here as well.  You can view or download the Asteroids Alive code from  Rucker's Asteroids Alive.

Rudy Rucker used Hall's Asteroids as an example of some exciting Java code to work on in his two Fall, 1999, sections of CS 151: Object Oriented Programming at SJSU.   During this course Rucker put the code into a more object-oriented form and added some new features including:

  • Toggle between (traditional) screenwrap or  having the objects bounce off the screen borders.
  • Asteroids avoid the bullets now.  The algorithm involves flying away from the closest bullet, if any, whose distance from you is presently decreasing.  Bullets more than half a screen away are ignored. 
  • Asteroids bounce off each other in momentum-conserving energy-conserving collisions.  The mass of these flat asteroids is thought of as proportional to the cube of their radius.
  • Round or a square world, with bounce and wrap.
  • Godmode in which you're invulnerable.

Back to Rucker's Asteroids Alive.

 Home         Biography         Books         Paintings & Links         Classes         Email