ARMADA
from Home Computing Weekly, 9th August 1983

A life on the ocean waves can be risky

Set sail for danger with Bill Freestone's Armada game for the Spectrum

Ahoy there! Why not come sailing with your Spectrum? All you need is 16K. As
you look across the deck of your Elizabethan galleon you can almost smell the
salty air wafting through you screen. But you're not here to enjoy the view,
Jim lad. There's work to be done.

The enemy are sailing across your screen and you have to sink them using the
ship's cannon. Just press Z, X or C to send a cannon ball hurtling towards
the enemy galleon.

The user defined characters are defined at the end of the program to keep
them out of the way of the main program loop. This means that to start the
program you must enter RUN 300. When saving type SAVE "ARMADA" LINE 300. This
will start the program at the appropriate place once loaded.

In case it is not clear which graphics characters should go into which lines
they are included in my "How it works" section.


How it works
 100-103   move galleon subroutine
           line 102 graphics: A,B,B,C,D,F,E
 110-134   fire cannon sub-routine
           lines 110,120,130 graphic: G
           lines 111,121,131 graphic: H
           lines 113,123,132 graphic: I
 200-205   sink galleon
           line 200 graphics: E,D,F,E
 210-240   game over
 300-575   define characters
 600-640   instructions


Hints on conversion
* Spectrum colours are set using INK and PAPER with the following numbers: 0
  black, 1 blue, 2 red, 3 magenta, 4 green, 5 cyan, 6 yellow, 7 white.
* Colour commands inside print statements set colours for that print only and
  not the whole screen.
* ATTR (R,C) reads the colour of the character square at position R rows and
  C columns. In this case it has been used to tell whether the enemy galleon
  has been hit.
* BEEP D,P sounds speaker for D duration in seconds, P pitch in semitones
  relative to middle C.
* DRAW X,Y draws line X pixels along and Y pixels up from last PLOT or DRAW
  command.
* DRAW X,Y,A draws a line X pixels along, Y pixels up and through an arc of A
  radians.
* CIRCLE X,Y,R draws a circle with centre X,Y and radius R.
* OVER 1 allows a character to occupy the same square as another one. If your
  machine cannot do this don't worry - it's only used to underline the title in
  line 600.
* POKE USR "A"+g,r is the way characters are defined on the Spectrum. In this
  case row g of character "a" is being given the value r.


Variables
A  column position of enemy galleon
J  number of enemy galleons passed (game ends when it reaches five)
P  used in a loop to change border colours while waiting for another game to be started
U  used to set up sea and sky
T  used to draw ship's deck
X  row position of cannon ball
S  score
G  graphics loop variable
R  data variable for graphics
