Personal Computer News


Vertical Takeoff Part 1

 
Published in Personal Computer News #092

Orrall Cornelius blasts off a game that demonstrates two of the Atari's special features.

Atari: Vertical Takeoff

Orrall Cornelius blasts off a game that demonstrates two of the Atari's special features

This simple game demonstrates two of the Atari's programming features - Player Missile Graphics (PMGs) and Display List Interrupts (DLIs).

The program is best understood if it's broken down into its three main parts: PMG, DLI and sound. Two parts of the program may be new to you - vertical positioning and DLI/mixed modes.

You've probably seen articles explaining PMGs and their usefulness in collision detection, priorities and movement of players and missiles.

The program here covers some of this territory, but it details another aspect of PMGs - vertical positioning and movement. On the Atari, vertical movement from Basic is slower than horizontal movement because there are no vertical positioning registers for PMGs, so the program incorporates a machine code routine for moving PMGs vertically.

It will move players up to nine pixels deep, but if you want larger players the number 11 in line 140 should be changed to two larger than the number of vertical lines the player uses. Then change the 10 in line 150 to one greater than the number of additional lines.

USR Calls

You can move any player by changing the number 511 in the USR calls in the joystick routine to one less than the start address of the object to be moved. If player 1 was to be moved the USR command would look like this:

U=USR(UP,PMCASE+639+Y):Y=Y+1

and for player 2:

U=USR(UP,PMCASE+767+1):Y=Y-1

The Y represents the variable used to move your players down the screen. You should note that the PMBASE variable may change from program to program - it sometimes appears as MYPMBASE or BASE, depending on the programmer's preference. Missiles are more difficult to move vertically with this routine since it moves an entire byte, not bits. It would come in handy when moving all four missiles vertically if you needed to do so, but they can still be moved horizontally individually.

Next Week

As Orrall Cornelius completes his games listing, you'll see a demonstration of display lists in action, with three moves on the screen at once.

Variables

SE seconds remaining
RN random positioning of the stars
X horizontal positioning of player 0
Y vertical positioning of player 0
X1 horizontal positioning of player 1
Y1 vertical positioning of player 1
A1$,B2$,C3$ stars
T timer
I mainly used as a variable in the FOR NEXT loops
DLIST display list
SCREEN mainly used for position of GR.0 in display list

Orrall Cornelius