JTF > Demo Gallery > assignments > Asteroids

 
This assignment plays a simplified version of the Asteroids arcade game, which was released by Atari in 1979. The goal of the game is to pilot your spaceship through an asteroid field, destroying asteroids as you go. Hitting a large asteroid causes it to break into three smaller asteroids, which means that you must hit each asteroid several times before the various bits and pieces are small enough to destroy.

The Asteroids program uses the following key bindings:

 Key
LeftA
RightD
ThrustS
FireW

One of the advantages of Asteroids as an assignment is that the objects on the screen form an easily understood graphical hierarchy in which the space ship, the asteroids, and the bullets all share the same properties of motion.

A similar assignment was described by Dan Leyzberg and Art Simon in the 2008 entries in the “Nifty Assignments” collection (http://nifty.stanford.edu/).