Classic Computer Magazine Archive Article from Compute! magazine

the UFO. If you average ten points or better per problem (but less than 25), you will earn 25 bonus points. There are no bonus points if you average less than ten points per problem. Bonus points are displayed with suitable fanfare.

There are a few features of Program 1 that require special mention. The joystick-controlled menu appears in Program 1 at lines 5000 through 5230. It uses screen memory locations to identify the choices available so that it is impossible to make an incorrect entry and cause an error.

Player/Missile Machine Language

The UFO is Atari Player 1 and the explosion character is Player 3. In order to rapidly exchange them when a correct hit has occurred, it is necessary that the two players always be at the same vertical position. (Then it is easy to POKE the UFO horizontally off the screen and to POKE the explosion at the former position of the UFO.)

BASIC was too slow to move both players vertically. A machine language program to move two players vertically lower on the screen is in lines 4000–4060. The parameters for the current location and length of the players are set by the subroutine at line 3500.

It is a little tricky and not at all obvious how to determine when the gun is over the correct answer. The playfield characters (the answers) and the players use different coordinate systems. It is necessary to establish an equation that maps one coordinate system to the other. The appropriate equations are:

X(P / M) = 4 * X (Playfield) + 45
Y(P / M) = 4 * Y (Playfield) + 17

where X and Y are the horizontal and vertical coordinates respectively. The X equation is used in line 2510 to determine whether the gun is over the correct answer, and the Y equation is used in line 3025 to position the number of points earned at the same height as the explosion of the UFO.

Programmer's Notes: VIC Version

The VIC-20 version of "Missile Math" requires at least an 8K expander. To make it easier to enter this version, the machine language portion of the program has been listed in MLX format. To enter Missile Math, you must enter Program 2 using the VIC MLX Program elsewhere in this issue. The starting address is 12288 and the ending address is 13295. After you have entered and saved Program 2, enter Program 3 as you would a normal BASIC program and save it to tape or disk.

To run Missile Math, you must first enter these POKEs.

POKE 43, 1 : POKE 44, 24 : POKE 641, 0 : POKE 642, 24 : POKE 6144, 0

Type NEW and load Program 2, bypassing the normal relocator by adding, 1 to the LOAD command. Here's how your LOAD command should look:

From tape:

LOAD "filename" ,1, 1

From disk:

LOAD "filename" ,8, 1

Now type NEW, then load and run Program 3.

Notes On The Commodore 64, TI, Apple, And IBM PC/PCjr Versions

Instructions for all these versions are included within the programs themselves. The 64 version (Program 4) requires a joystick in port 2. The TI-99/4A version (Program 5) requires Extended BASIC and may be played with either a joystick or the keyboard. The Apple version (Program 6) requires a paddle controller. The IBM PC/PCjr version (Program 7) is controlled from the keyboard.