(back to project list)

Disassembly of Sabotage for the Apple II

Sabotage is a "fixed shooter" arcade game developed by Mark Allen. The player has control of a turret that can swivel but can't otherwise move. Helicopters and planes fly overhead, dropping paratroopers and bombs.

Sabotage is copyright 1981 by Mark Allen and On-Line Systems.

How to play

title instructions play

The game begins with helicopters flying across the top of the screen, occasionally dropping paratroopers. If a paratrooper lands on the gun turret foundation, or four land on one side of the turret (or three manage to stack up right next to it), your turret will be sabotaged and the game is over. The player uses a fixed gun turret to shoot down the helicopters and paratroopers.

After a set amount of time has passed, the difficulty increases, with helicopters flying lower to the ground. After a few rounds, the helicopters will be replaced by bombers, which drop bombs that will destroy the gun turret with a single hit. Bombs must be shot down or the game will end. The bombing phase continues until a specific number of bombs has been dropped. The number of bombs per bomber wave increases as the game goes on.

The turret is controlled with the keyboard or a single game paddle. The game will use whichever paddle moves first, which can make choosing an axis tricky with a joystick. The 'D' and 'F' keys move the gun toward the left and right. All other keys, and the appropriate paddle button, fire a shell.

Shells can optionally be steered, changing velocity to match the angle of the gun. Non-steerable shells move faster.

Shooting the parachute off of a falling paratrooper will cause it to plummet to the ground. If a landed paratrooper is standing under it, that will die also. Shooting a helicopter or bomber will generate a random amount of shrapnel, the larger pieces of which can destroy falling paratroopers and other aircraft.

Points are awarded for destroying things, but one point is subtracted every time a shell is fired. This discourages the "spray & pray" gaming style.

Under the Hood

The game tracks various entities:

A simple array is used to hold the number of landed paratroopers in each column. It's actually a ground height array, with elevated values for the gun foundation and turret, and is used to determine when a paratrooper should stop falling.

Helicopters start flying in two "lanes" near the top of the screen, but every 768 frames (about 40 seconds) the number of available lanes increases, allowing lower flights. After the 5th expansion, the game switches to bomber mode. The bombing phase lasts until (N+1)*4 bombs have been dropped, where N is the difficulty level. The difficulty level starts at 0 and can go up to 5, increasing at the end of each bombing phase. Higher difficulty levels also increase the density of helicopters, and the likelihood that they will drop a paratrooper.

Paratroopers can't drop too close to the edges, and won't pile up to a height of more than four. With sabotage disabled, the play field will eventually look like this:

all para

All collision detection is pixel-accurate. If two objects appear to overlap, the relevant bytes from the bitmaps will be retrieved and masked to see if the pixels collide.

Shells move roughly 8 or 12 pixel per frame (steerable / non-steerable). The shell is moved a single pixel at a time, with collision detection after each move.

There appears to be a bug in the collision detection for falling bombs. The code at $6ae0 is supposed to be walking through the list of shell structures, but uses the wrong structure size. This means that every entry after the first is reading incorrect data, and will likely fail to detect a collision. Bombs are 4 units high, and have a maximum vertical speed of 5 pixels/frame, so as it gets close to the gun it can easily step over a shell that should hit it.

Graphics are drawn on hi-res page 1 only. All graphics are drawn and erased with exclusive-OR operations, which removes the need to be careful about the order in which operations happen. Most objects follow an erase-draw-update pattern; keeping the erase and draw close to each other reduces tearing. The largest moving objects are helicopters and bombers, at 4 bytes by 10 lines; these are drawn and erased simultaneously, row by row, to minimize flicker.

Helicopters, bombers, walking paratroopers, and shrapnel all have single-pixel horizontal movement. The hi-res screen architecture requires seven bit-shifted versions of each shape. The game uses slightly different images for each position, so that as shapes move horizontally, the helicopter and bomber propellers twirl, the paratrooper feet move, and the shrapnel spins.


Copyright 2024 by Andy McFadden