
AIR RAID
by Stephen Ormrod
from ZX Computing Apr/May.1983

Run for cover - here comes a smashing program from Stephen Ormrod of Bury.


In this program, Stephen has taken trouble to incorporate
moving graphics, simple rules and an emphasis on strategy
rather than relying on Lady Luck. Indeed, it took seven
versions of the program before Stephen was happy enough to
send it to us!

The rules of the game are quite simple. You begin the game
with 30 bombs for your skycraft and you can release a bomb
by pressing the '0' key. Your aim is to hit all the enemy
ships and 'planes you can within the restriction of how many
bombs you have. If a ship reaches the landing stage before
you can destroy it you will lose one of your valuable bombs,
and you are further restricted by only being able to fire
one bomb at a time (if there is a bomb still on-screen, you
will not be allowed to fire another).


Plain sailing?

When you first RUN the program, the Score Advance Table will
appear on the screen. From this you will be able to see that
ships are more valuable (in terms of how many points are
scored) to destroy than 'planes. The aircraft are not easy
to hit - but there is no penalty for allowing a 'plane to
escape your fire.

After pressing the 'S' key, the score table is erased and
you should get your finger over the '0' key - this is the
only control key used in the game. Your ammunition will
appear as a series of 'grated railings' at the top of the
screen. The sea will appear at the bottom of the screen with
a landing stage in the bottom right-hand corner. You are
positioned in a skycraft, sited just below your ammunition
dump at the top of the screen.

Your skycraft slowly 'circles' the sea harbour - you travel
across the screen from right to left, and when you disappear
on the left-hand side you miraculously appear on the
right-hand side again. The white speck in the centre of your
skycraft indicates that you have a bomb on board.

Ships will appear on the left-hand side of the screen and
slowly move toward the landing stage. As you move across
thEe screen in your skycraft, you must decide when to
release your bomb in order to destroy the ship. If you
manage to score a direct hit on the ship you will be
rewarded with the ship being swallowed up by the mysterious
deep. However, if you miss the ship, the bomb will explode
harmlessly in the sea and the ship will dock at the landing
stage, its troops will disembark unopposed and steal one of
your bombs.

Periodically, an enemy 'plane will fly across the screen
from left to right, moving twice as quickly as their naval
colleagues. They are not trying to reach the landing stage,
their object is to get between you and the ships, thus
blocking your bomb. There will only ever be one ship or one
'plane visible on the screen at any time, but a plane and a
ship may be seen together.


A shot in the dark

One of the problems you will encounter is judging when to
release your bombs so that they will destroy the ships. One
tactic you could employ is the 'shot in the dark' option in
which you release a bomb before a ship has yet come onto the
screen. But remember, you have only 30 bombs, so it's best
to make them count.

When you have used up your 30 bombs, the display will scroll
upwards so that the 'sea' ends up at the top of the screen.
The score you have achieved during the game is then
displayed, followed by the top highest scores of the day.
The sea will then begin rolling again and the ZX81 will wait
for you to press '0' signifying that you would like another
game.

To help you decipher the program listing, perhaps the
following would be useful. The ships and aircraft are held
in string arrays, A$, B$ and C$. Cruisers, represented by
A$, are generated as follows:

A$(1) - "Space, Graphic 8, Graphic 4, Space"
A$(2) - "Space, Graphic 8, Graphic 5, Space"
A$(3) - "Graphic R, Inverse Space, Inverse Space, Graphic E"

B$ is used to represent the aircraft and is comprised of the
following:

B$    - "Graphic 7, Graphic 7, Graphic 6, Graphic E"

Battleships are held in C$ and are made up as below:

C$(1) - "2 Spaces, Graphic 3, Graphic 5, 2 Spaces"
C$(2) - "2 Spaces, Graphic 8, Graphic 5, 2 Spaces"
C$(3) - "Graphic Y, Graphic 6, Graphic Q, Graphic W, Graphic 6, Graphic T"
C$(4) - "Space, Graphic R, 2 Inverse Spaces, Graphic E, Space"

The ammunition dump is generated in line 134 and comprises
30 Graphic Qs. The string array, D$, is your skycraft and is
shown in line 135 as an Inverse Dot and a Space. Line 150 is
made up of 31 Graphic As and one Inverse Space.

E$ and F$ are alternating Graphic As and Graphic Ds ending
in an Inverse Space. Note that E$ and F$ run in antiphase
and alternate in subroutines in lines 7000 and 7020 to make
the wave-like motion of the sea.

Lines 200-270 represent the 'core' of the program. The rest
of the listing comprises a number of routines which are
called from time to time from the main program. Try working
out what does what.

Here is a list of variables used in the program to help you
work out how the program works.

Array V(6) - The six best scores.
Array U(3) - Whether or not a 'plane or ship is visible.
 SC - Player's score.
  F - Flag controlling whether or not a bomb is loaded aboard your aircraft.
 YU -  Position of waves on the sea.
 PO - Position of last ammunition in the dump.
AMM - The number of bombs left (plus one).
  X - The horizontal position of the skycraft.
  Y - The horizontal line of the falling bomb.
 AS - The controlling variable for what will appear on the screen next.
  L - Control variable in loops.
  N - Control variable in loops.
 SB - Individual score awarded for hitting a ship or 'plane.


--
Another Fine Product transcribed by:
Jim Grimwood (jimg@globalnet.co.uk), Weardale, England
--
