Classic Computer Magazine Archive ST-Log ISSUE 20 / JUNE 1988 / PAGE 38

Decimal Destroyer

GAME

by Kevin Kennedy

One of Mr. Kevin Kennedy's projects in a Colorado State Science Fair, Computers for the Impaired, won an award from the IEEE (Institute of Electrical and Electronic Engineers).

Low Resolution

Some time in the future, thousands of asteroids were detected floating toward Earth. Fortunately, because they were found soon enough, hundreds of robot ships were sent to destroy them. These ships were controlled by people on Earth. Though they had only a few controls, including rotate, thrust and fire, they were able to destroy most of the asteroids, but there were still some heading for Earth. They had anticipated this problem and built a sophisticated and expensive defence system. To our surprise, the guidance module was never installed. Once again, people were called to help save Earth.

The method of operation for these systems was completely different. The Earth was divided into ranges. The length of the ranges depended on the expected amount of asteroids. The range would be smaller if more asteroids were expected in that area and larger if there were only a few asteroids expected. The ranges were measured in miles. Because computers were supposed to be handling this system, some ranges were specified in fractions of miles. For example, in an area where many asteriods would fall the range would be small, like .25 miles. Missiles were used to blow these asteroids out of the sky, and were launched by specifying their location in the range. For example, if a missile were to be launched in the middle of a one mile range, the value .5 would be entered into the computer.

In Decimal Destroyer, you have been called to be one of the defenders of Earth. Before the game starts, you will be asked what level you want to start on. Levels go up to seven, one being the easiest. When the game starts, you must enter a number between the ranges. The range extends from the number on the left of the window, always zero, to the number on the right. You can enter any number between 0.000 to 9.999, not going past the thousandth place. You will be told if your number is out of the ranges.

During the game, asteroids are descending and must be hit before they reach the ground. You can miss an asteroid three times before you will be told what number you should have entered.

When you destroy either two or four asteroids, depending on what level you are on, you advance a level. You are allowed five misses per game. A miss occurs when an asteroid hits the ground. The game ends when you either run out of misses or you complete level seven. You will then be rated from excellent to try again.

The Program

Decimal Destroyer is written in Personal Pascal by OSS and CCD. It uses GEM calls so it needs all the Pascal GEM support files and must be compiled with GEM selected.

Decimal Destroyer uses XBIOS calls for sound, random number generation, and to shake the screen up and down. The shaking effect is done by quickly adding and subtracting 1280 to the physical screen base.

Because pascal does not have any raster copy functions, I used an old animation technique. Rather than drawing, than erasing the entire object, only the parts of the object that need to be drawn or erased are handled. For example, on the rocket only the nose and the tips of the fins are drawn and only the bottom part is erased. When the rocket ascends it appears to be a solid object. The problem with this method is that objects can travel only in one direction and only one step at a time.