STARFIGHTER
by Han Crielard
from ZX Computing Feb/Mar.1986

Han Crielard has been stargazing in the Netherlands and
invites all budding space pilots to try shooting them!


The object of the game is to shoot at the stars (inverse
'*") which grow up. If there are four stars above each
other, you lose a life. Your task is to prevent such a group
of four stars forming. You shoot at the stars, and if you
hit them, they are destroyed, but not for long. The game
ends when you have run out of lives (you begin with three).
If you beat the high score you can enter your name (up to
thirteen characters), and at the end of the game the
following options are displayed:

Press 1 for instructions.
Press 2 to play again.

Pressing '1' or '2' will give the appropriate response. You
gain an extra life upon reaching 2000 points.

The program is divided into two parts, BASIC and machine
code. The machine code prints the score in inverse
characters at the top left of the screen, and increments it
by ten points at a time.

First, type in the machine code loader and RUN it. The
computer will display a series of memory addresses and ask
you to INPUT some numbers. These are given in the
disassembly listing (figure 1). Then type in the BASIC
listing and you are ready to start.

The graphics characters in line 310 are the graphics
characters on the 'A' key.

To SAVE the game, type GOTO 9000. The game will SAVE itself,
and then RUN.

If you find that the score needed to gain an extra life is
too high, then alter line 830 as required.


Figure 1. Disassembly listing

          MACHINE DISASSEMBLY

LABELS    ADDRESS  ASSEMBLER
------    -------  ---------

SET UP    16541    NOP             0
          16515    NOP             0
          16516    LD HL,(D_FILE)  42  12  64
          16519    LD DE,512       17  0   2
          16522    ADD HL,DE       25
          16523    LD (16514),HL   34  130 64

SCORE     16526    LD HL,(D_FILE)  42  12  64
          16529    LD DE,12        17  12  0
          16532    ADD HL,DE       25
          16533    LD A,(HL)       126
          16534    INC A           60
          16535    CP 166          254 166
          16537    JR NZ,5         32  5
          16539    LD (HL),156     54  156
          16541    DEC HL          43
          16542    JR 245          24  245
          16544    LD (HL),A       119
          16545    RET             201


BASIC listing.

Lines

1         machine code
10-90     makes the screen black, and sets up variables
99-210    print the instructions on the screen
220-390   print the same screen
399-460   variables used in the shoot routine
470-480   start key routine
489-840   main program
999-1040  move spaceship left
1999-2040 move spaceship right
2999-3230 spaceship's shoot routine
3999-4210 'lost life' routine
4999-5060 print lives on screen
5999-7530 game over routine, and print instructions
7999-8300 input name and high-score
8499-8610 extra life routine
8999-9030 SAVE routine


-- end of file --
