Asteroids - Ian Collier (Your Computer-November 85-Page 82)

IAN COLLIER BLASTS BADDIES

Asteroid Attack is a program for the 16 or 48K Spectrum which is probably as
close as the Spectrum allows to the arcade version. It has full rotation not 
limited by the scope of graphics characters; the ship is drawn onto the screen
using sines and cosines. Thrusting provides the ship with frictionless motion
up to a maximum speed of just less than that of a bullet.
 The ship and bullets are moved to an accuracy of 1/128 of a pixel (stored -
not on the screen). Obviously the sound cannot reach the high arcade standard,
but I have created the best possible effects.
 The machine code is created by the two highspeed data loaders. Type in the
first Data Program and save a copy. Run the program and if lines 100 and 110
are correct, the machine code high-speed loader will be saved. If they are not
correct, check and double check these lines until they are. If this machine
code is correct, the Save and Verify statements can be removed from line 70.
 After line 110 has been slow-poked, the other lines will be fast-poked into
place (see the difference?). If this does not take place, reload the program
and check lines 100 and 110. Don't worry about the mess on the screen as the
highspeed loader runs; this is the only place to store the code as yet. When
all the errors have been corrected, the code will be saved. Save another copy
of the program as well. New the machine and type in program 2. You needn't
bother about lines starting with Rem.
 Run the program. If the fast-load code is not in place, it will be loaded be- 
fore part 2 of the machine code is fast-poked into place. Again, correct all 
the errors and save the code. Also save the program. New the computer and ty-
pe:
        CLEAR 26900: LOAD "ASCODE1"CODE 26922: LOAD "ASCODE2"CODE 29242
 Play the tape on which you saved the two parts of code. The machine code is
now set up. The graphics pointer can be set up by
        POKE 23675,42: POKE 23676,108
and the new character pointer by
        POKE 23606,42: POKE 23607,104
If you like you can test the code by
        RANDOMIZE USR 28501
 Type in the main Basic program. The finished program can now be saved by
        CLEAR: SAVE "ASTEROIDS" LINE 500: SAVE "ASCODE"CODE 26922,4671
 You will notice if you do the Pokes above that I have designed a new charac-
ter set. The capitals and digits - also all brackets, string and hash - have
been made slightly larger and closer to ordinary script. An advantage of this
is that capital A looks like a ship and so is used to print the 'lives'. You
can shorten the typing by removing this - omit the character pointer Pokes
above from the program, also omit lines 120 to 200 inclusive of Data program
1 and change:
        LET a=16384
in line 70 to:
        LET a=17104: LET x=20
 You can also shorten typing omiting the fast-poke code, though the program
will take ages to poke to data. To do this, omit lines 100, 110 in Data pro-
gram 1, also omit 30, all but the first statement of line 70, and change 10
to:
        RESTORE: LET a=16384 (17104 to omit the character set): FOR x=120
        (210 to omitthe character set) TO 400 STEP 10
Also omit 3 and 30 of Data program 2 and add all the lines which in the lis-
ting start with Rem, but do not type Rem - (except line 1). However the fast-
poke code greatly reduces poking time and can be used in other programs where
hex has to be poked into memory and a checksum is provided. The syntax is:
        PRINT USR 23296, destination, hex
- either a string name eg.a$ or a string of digits eg. "01ed2f", checksum -
(the sum of all the bytes in a string).
 Having saved a copy of the finished program onto tape (with or without cha-
racter set and/or fast-poke), you are now ready to clear the computer and load
it.
 You are given the option to play the game or redefine the keys - no joystick
option, I'm afraid; Interrupt mode 2 on a 16K machine crashes with certain pe-
repherals attached. If you do not redefine the keys they are X-left, C-right,
L-fire, P-thrust, Z-Hyperspace, and Space-Abort. You will appear in the centre
of the screen. The object is to avoid being killed by the rocks hurtling to-
wards you by blasting them out of space. These large rocks, on being hit, will
split up into two smaller asteroids, which in turn split up into two small 
ones.
 These are destroyed when you hit them. If one hits you - and all crashes are
screenchecked, so no gyps - you explode and, providing you have a life left,
you will appear back on the screen when a box 100 by 80 pixels is clear of as-
teroids. If you think this box is to large or too small, you can alter its si-
ze (see Pokes Table). In a desperate situation, hyperspace takes you away from
the path of converging asteroids and plants you in a random position on the
screen. However, this may move you into the path of another asteroid - so use
with caution.
 Levels vary in difficulty, partly because more asteroids appear. There are 
also alien ships which career across the screen firing at you. It can split
asteroids - you get the points - but this can be a hazard as more small aste-
roids are created. If it crashes into an asteroid, it has a chance of being 
blown up - you don't get the points. There are two sizes of alien: slow large
ones - these usually blow up on contact with anything - and faster small ones
- these may not blow up on contact with an asteroid. The following pokes are
available - normal contents are in brackets.
 
 28510 Number of lives. (do not use more than 32. However if you use more than
       6, the score will be printed on top of them.) (3)
 28515 One less than the starting number of asteroids. If you poke this with 
       an odd number, you will not be able to be killed. (2)
 31099 Controls the generation of aliens. A higher number gives increased pro-
       bability. (11)
 31116 Controls the type of aliens. A higher number means a greater proportion
       of large aliens. (15)

 The following locations hold the parameters for the box which must be clear
of asteroids before your ship is printed:

 30773 Left x coordinate (78)
 30777 Right x coordinate (178)
 30784 Bottom y coordinate (48)
 30788 Top y coordinate (128)

 If you abort a game with a high score, your achievement will not be recogni-
sed. To change this, remove line 310 from the Basic program. If the program
seems too daunting, I will supply a cassette of the completed game for 2.00
to: Ian Collier, 57 Wyndham Avenue, Bolton, BL3 4LG.

------------------------------------------------------------------------------
TYPE: Arcade  

COMMENT: The author of the game Ian Collier was so kind to inform me about  
a mistype Your Computer did with this game. In the text to the game, instead
of:
        PRINT USR 23296

it should state:

        PRINT CHR$ USR 23296


This info file was typed by Michael Bruhn

Downloaded from:
Desert Island Disks -- http://www.image.dk/~frankie/
Maintained by:
Michael Bruhn -- frankie@image.dk

