
SUNTRAP
by Mike Moscoff
from Popular Computing Weekly 2nd December 1982


You control a laser station, protecting a moon base from the dreaded
Krugs. The Krugs, traditionally evil, have vowed to wipe out all
Yoomans.

When run, the program displays brief instructions. Reply 0 or 1 to the
query about difficulty level required. Wait one minute while variables
are assigned and the screen is drawn.

The game starts with a bleep. Use keys 5, 6, 7 and 8 to move your
sights (left, down, up and right). Use keys 0 or 1 to fire. The game
ends when all your power is gone.

How it works:
 900-990   Displays the instructions.
 700-790   Sets up all variables, and defines special characters.
 800-890   Draws the screen.
  70       Prints the score.
 100-140   Moves your sights.
 150-190   Fires your laser.
 200-220   Explodes alien if hit.
 300-340   Moves the alien.
 343       Fires the alien laser.
 360-390   Sets up a new alien.
 600-690   End of game routine.

To test the program, first enter lines 30, 35, 45-220, 700-790,
870-890, and RUN. This should define all variables, print score, move
your sights (keys 5-8), and fire the laser (keys 0,1). Then add lines
40, 300-385. The alien should move randomly from left to right and
hits should be registered. Finally, add lines 20, 600-690, 800-850,
900-985.


Enhancements

The speed can be improved slightly by:
(1) Deleting all REM statements.
(2) Deleting BEEPs in lines 130,160,175,330 and 343.
(3) Deleting all the fancy visuals.
(4) Using machine code.

The end routine (lines 600-690) could be improved by adding:

 620 LET r$="": LET r$=("try harder" AND
     sc<200)+("well done" AND sc>199
     AND sc<400)+("excellent" AND
     sc>399)
 630 PRINT AT 12,12;r$

Also, a "High score" could be added:

 975 LET hi=O
 635 IF sc>hi THEN LET hi=sc: PRINT AT
     14,12;"HIGH SCORE!"; AT 15,16;hi

Variables:
ux,uy       Sights x,y position.
uxo,uyo     Sights old position.
tx,ty       Aliens x,y position.
txo,tyo     Aliens old position.
tc          Aliens position change.
po          Power.
sc          Score.
lz          Number of laser bolts fired.
tno         Number of aliens.
ki          Number of kills.
df          Difficulty setting.
ht          Hit flag.
lcx,lcy     Sights plot position.
t$          Alien characters.
u$          Old alien characters, and INKEY$ response.
r$          Your replies.

Graphics characters:
A           Sights.
B           Alien-1.
CD          Alien-2.
CED         Alien-3.
F           Explosion-1.
G           Explosion-2.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
