Getting started with Spacewar

You're in control of a little red triangle ship. Your goal? Avoid being bumped by asteroids and shoot the asteroids into pieces. When enemy UFOs appear, avoid being shot by their bullets and try to shoot them. In other words, shoot everything in sight before you get shot! Use the spacebar or left mouse clicks to shoot at the other creatures. (If you dislike shooting games, skip Spacewar and try PickNPop, Airhockey, Ballworld, 3DStub, or Dambuilder.)

The asteroids and UFOs in the Spacewar game have a primitive kind of intelligence. They run away from the bullets that the player shoots. And when they're not running away from bullets, the asteroids tend to move towards the player. Some users have described the Spacewar asteroids as 'cowardly and sneaky.'

You are only allowed to have eight of your bullets active at one time. When you try and shoot more than eight bullets, your oldest bullet is removed. This means that if you keep the spacebar down so as to be continuously shooting, you will see something that looks like a short stick of bullets coming out of your player. What's happening is that the furthest (oldest) bullet keeps being replaced by the next bullet that you're shooting out. In order to have your bullets travel some distance and hit the further away asteroids, you need to release the spacebar and give the bullets a chance to travel. Once a bullet is traveling, it will live for three seconds. A bullet will also die if hits an asteroid, a UFO, an enemy bullet, or the edges of the game world. Once a few of your bullets die off, you can shoot some more bullets.

Your player incurs damage if it is touched by one of the asteroids or by one of the enemy bullets; 'damage' means that the player's health is reduced by one point. If the player's health reaches 0, the game is over. The current health value is printed in the status bar below the game window.

Use your Arrow keys to run away from enemy bullets and missiles. At startup, your controls are in the Spaceship Controls mode; this means that the Left and Right arrows rotate the player's icon and shooting direction, while the Up and Down arrows add forward or reverse thrust in the direction that the player's icon is currently pointing. If you've never played an Asteroids-type game you will initially find these controls hard to use. The idea is that the player is supposed to be drifting in empty space and that you are steering it with blasts from its rocket. If you're not comfortable with the Spaceship Controls, you can use the Player menu to select a different control mode; Scooter Controls are particularly easy to use.

Shooting the asteroids, UFOs, enemy bullets, and enemy missiles increases your score. Note that you don't get a score reward for splitting an asteroid or UFO in two, you only get the score when you actually eliminate one. The current score value is printed in the status bar below the game window. Increasing your score by 40 brings on a new attack by a UFO.

When you kill all the asteroids and UFOs, a new wave of asteroids appears, and the maximum speed of the asteroids and UFOs is increased. Eventually they overwhelm the player and use up all of the health points.

When your player loses all of its health points, the region of your window outside the game world goes from gray to black. A message dialog appears. Click in the dialog or press Enter to restart the game. If you would prefer to play a different game, use the Game menu.

The status bar below the game window displays the player's score, the player's health, the total number of non-bullet critters on the screen (including the player critter), and the number of updates per second that your machine is currently doing for the animation.

Spacewar details

The critters collide with each other and rebound. The critters collide as if they were spheres with a mass proportional to their size. If two critters have an irregular shape this means that they will sometimes appear to collide before they visually touch each other.

When an object hits the edge of the game world it may either bounce, wrap around to the opposite edge, or die. At startup, the asteroids and the player wrap, the enemy UFOs bounce, the bullets die at the edge of the game world, and the enemy missiles bounce. You can force the asteroids to bounce off the edges by selecting Game | Bounce instead of Game | Wrap. This makes them a bit easier to shoot because then they can't run away as well. Note that the UFOs and blue enemy missiles will bounce off the game edges even if you have selected Game | Wrap, and that your bullets and the green enemy missiles or bullets will always die when they hit the game edges.

The starting number of asteroids is eight. When you shoot a larger asteroid, it will split in two as long as the resulting number of asteroids is not too large. At some point, if there are too many asteroids on the screen, shooting a large asteroid will shrink it to a small asteroid the first time you shoot it, without splitting. Shooting a smaller asteroid will always kill it.

When the player shoots a bullet, the velocity of the bullet is the vector sum of your own velocity in the bullet's direction plus the bullet's muzzle velocity.

To observe this feature, you can do as follows. Use Player | Shield to make the player invulnerable, press the Up arrow to get the player moving rapidly, use the Left arrow to rotate the player to point at right angles to the direction of motion, and then press the spacebar to shoot bullets. You'll notice that the bullets emerge and move off at an angle. Though this is physically correct, some users find it confusing.

The UFOs don't obey this 'bullet velocity = shooter velocity + muzzle velocity' rule; the game lets them ignore the physics so as to make it easier for them to reliably shoot right at the player. To sum up, a UFO's bullet goes exactly in the direction its gun is pointing, but the player's bullets go in a direction that's a sum of the gun direction and the player's motion. (If you really, really dislike this feature, get the Pop source, make the player critter shoot like a UFO critter, and rebuild the game!)

There are two kinds of UFOs, regular and smart. The smart UFOs can move twice as fast as the regular UFOs, which makes them harder to shoot. The regular UFOs split in two the first time you shoot them, no matter how many asteroids are present. The smart UFOs don't split. The regular UFOs have polypolygon sprites and shoot green bullets at you. The green bullets are aimed at you, but they can be deflected by asteroids. They will die if they hit the edge of the game world. The smart UFOs have a sprite that's a picture of a flying saucer; these guys shoot blue guided missiles at you. The missiles will follow you as you move, and they will bounce off the asteroids and off the edges of the game world.

Use the spacebar to shoot the bullets and missiles before they hit you, or use your Arrow keys to move out of the way of these bullets. Note that the UFOs never wrap around the edges of the game world; the best hope of hitting one is to first drive it into a corner.

Your score value for killing various creatures is the following. You don't get any points when you first shoot an asteroid or a UFO and split it in two, you only get the score when you shoot the smaller pieces and remove them from the screen.

• Asteroid




• Green enemy bullet


• Blue enemy missile


Your player's health is improved by one point for every additional 100 score points you accumulate. Every time you accumulate 40 more points, a new UFO will appear, provided that no UFO is currently present.

More about shooting

As mentioned earlier in this help file, the spacebar causes the player to shoot bullets in the direction in which the player sprite is pointing. Bullets are shot as long as the spacebar is held down.

In the case where the Shoot cursor is selected, the left mouse button or the Z key will also shoot. In addition, the left-click or Z key will aim the player in the direction of the current mouse position before shooting. Using the Shoot cursor you can fire at targets simply by left-clicking or Z keying on them.

If your player (or an armed enemy) happens to be too near the edge of the world, it will not be able to shoot bullets, as any bullet near the edge gets removed.

Using the Player menu you can choose between Deadly Bullets, which split or destroy the asteroids and UFOs, and Rubber Bullets, which merely push them around. In a battle game like Spacewar, rubber bullets are of no use. They're here so that developers can consider using the feature in a non-violent game.

Rubber bullets are destroyed only when the screen is reseeded or you select Game | Start or Restart Game. But, as with deadly bullets, if you shoot a steady stream of rubber bullets, the older ones are repeatedly replaced by the newer ones. And if you have switched from rubber bullets to deadly bullets, the newly fired deadly bullets will replace the old rubber bullets. If a deadly bullet and rubber bullet collide, they both survive.

Other things to try in Spacewar

Try using the Player | Shield to make the player invulnerable so you don't have to keep restarting the game.

With the Shield mode on, use the Game | Large Critter Count selection to bring a large number of asteroids onto the screen. Use the Arrow keys to move the player around among them. Select Player | Rubber Bullets and shoot rubber bullets into the crowd. The way the rubber bullets work their way along is a model of particle diffusion. Try this both with Game | Wrap and with Game | Bounce. Use Game | Medium to get back to a reasonable number of sprites.

You can turn a background bitmap on or off from the View menu. And you can use Game | Wrap or Game | Bounce to turn a wrapping feature on and off for the player, the asteroids, and the rubber bullets. (The UFOs will always bounce and the deadly bullets will always die at the game world edge.)

Try turning Wrap on, setting Player to Shield and Rubber Bullets, and now use the rubber bullets to get all the critters moving in one direction. Then turn around and shoot rubber bullets till they move the other way. Turn off the View | Background Bitmap and use View | Wireframe to see the motions more clearly.

Set Player | Auto Play and sit back and watch the shapes zoom around.

Use Window | Additional View of Current Game to open a second view. Shoot some bullets. Notice how the action in the game is reflected in the second view.

    Part I: Software Engineering and Computer Games
    Part II: Software Engineering and Computer Games Reference