NUCLEAR ATTACK by Matthew Homer from ZX Computing Dec'83/Jan'84 [NOTE: This program requires Issue 2 emulation because of the way] [it uses IN for scanning the keyboard. JimG ] Defend the cities from the enemy missiles in this fabulous Spectrum simulation from Matthew Homer of Port Headland, Australia. In this program, you are in charge of a nuclear missile site which has been constructed to defend six cities from sudden nuclear attack. And your job, thankless as usual, is to stave off the missiles so that the cities can be evacuated. There are six cities in all to save, and from your nuclear base you have 30 surface-to-air missiles which you can launch at the on-coming missiles. However, watch out for your base because if that gets hit, you will lose all of your missiles. You fire a missile by manoeuvring an 'X' around the screen and hitting the fire button, All the keys required to move the 'X' in any one of eight directions and fire your missiles are given as part of the instruction routine within the program. Point to point For each missile you shoot out of the sky, you will receive 1,000 points, and if you manage to save any of your cities after a barrage of missiles you receive bonus points. Once you surpass 50,000 and 100,000 points, you get a bonus city to save. Your only other real worry is that every now and then an aeroplane will move across the screen and drop a number of missiles. However, the 'plane is considerably lower than the enemy missiles usually start at, so it's best to take out the 'plane just as soon as you can - especially, before it unloads its deadly cargo! One other small tip, but one I'm sure you'll soon get the hang of, is that it's best to aim your missiles a little before the enemy missiles, so that they actually run into the explosion. Okay, have some fun - but remember, anything has got to be more fun than the real thing! Line by line Here follows a breakdown of the program, Nuclear attack, so that you should gain more of an insight into its intricacies: Lines 2-62 Initialisation of the score and variables. Lines 65-95 Determines the course and targeting of the new missiles. Lines 100-995 Scan the keyboard and determine the movement of the missiles. Lines 1000-2060 Control the movement of the sites and determine if the defence missiles are to be fired. Lines 2100-2209 Decrease the rate of the barrage against the cities, determine whether the attack has finished or if all the cities have been destroyed. Lines 2210-2438 Form the scoreboard routine. Lines 2500-2760 Form the bonus points routine. Lines 3000-3170 Control the bomber and initialise the bomber's missiles. Lines 4000-4130 Contain all the user-defined graphics. Lines 5000-5200 Form explosions on the screen when missiles or bombers are hit by the defence's missiles. Lines 6000-6049 Control the firing of the defending missiles. Lines 6050-6078 Contain the instructions for the game. Lines 6080-6120 The initial display which you see when the program is first run. Lines 6130-6310 Control the setting-up of the screen and the setting-up of the missile sites when stocks are not all used up. Lines 6330-6900 Control the drawing of the missile storage on the bottom of the screen. Lines 7000-7150 Control the explosions of the defence's missiles. Lines 7200-7620 Form the nuclear explosions and the mushroom cloud. Lines 7985-8200 Eliminate the missile trails and/or the cities' locations, ensuring that any new missiles will not aim at locations of already destroyed cities; these lines also calculate the loss of missiles if the defence site is hit. Line 9005 The saving routine. To save the program on tape, simply type 'GOTO 9005'. Typing tips The following lines are ones which can be left out or replaced should you wish to type in the program in stages. Obviously, REM statements can be left out, but for your own piece of mind you may well be better off inserting a few here and there to give you an idea of how the program operates. Anyway, here are the areas of the program you can modify: Lines 2210-2438 This routine forms the scoreboard, but could always be replaced with a STOP statement. The scoreboard routine could also be used in other programs, using SS as the score variable. Lines 6080-6120 The display when the program is first run. Lines 7268-7620 The nuclear explosion and mushroom cloud. These lines may be replaced by the far less spectacular routine shown in Fig.1. [see file "Fig.1" in NUCLEAR.TAP JimG] -- Another Fine Product transcribed by: Jim Grimwood, Weardale, England --