Protector - Patrick Donnelly (Your Spectrum-No.11-Page 75) Here's a game for the more military-minded of you! As a Private in the Intergalactic Army, you're in charge of the laser base that's been ordered to defend the space station Speccy3. The invading alien hordes are throwing all the hardware they can at you, including R3 and K6 fighters, as well as the deadly XTC missiles. All you have to do is shoot them out of the sky before they explode against the walls of the space station. Speccy3 starts off with 25 shields to protect it, but one is lost each time an enemy fighter or missile breaks through the defence. You gain 50 points for each enemy craft you shoot down, but you'll lose 10 points for each one that explodes against the space station walls. You'll be promoted through Corporal, Sergeant and Captain to General, depending on the score you're left with when the game's ended. On RUNning the program, once you've read your way through five pages of on-screen instructions, the playing area is taken up with a panel indicating your current score, the amount of ammunition you've got on-board the laser base, the number of shields the space station has left, and the overall 'high score'. At the foot of the playing area, you're allocated a single laser base, that you control using the 'Q' key to move left, the 'W' key to go right and the Space key to fire a laser bolt. Lines 2-80 Set the BORDER and PAPER colours, and call two subroutines. The first, at line 9800, creates the user-defined graphics. The second subroutine, at line 8500, prints up the instructions for play on-screen. Lines 110-120 Set up the 'high score' table and fill it with the initial high scores (which just happen to be by Patrick himself!). Of course, you could always type in your own name instead ... Lines 130-210 Set up the initial game variables. (X1,Y1), (X2,Y2) and (X3,Y3) are the positions of the first, second and third attackers. Here's a list of the order variables you should know about: Y - the position of the laser shot; Y0 - the laser base position; SD - the shields; TEST - the extra ammo condition; TT - the triple points indicator; SC - the score; and SH - the ammo you start with. Lines 400-990 Set up the initial enemy positions and print them up on-screen. Lines 995-1300 Check the game status. If you want to start looking to change any of the programming at this stage, take a look at lines 1010 and 1050. Each could do with some work ... Lines 1350-1460 Scan the keyboard and jump to the required subroutine depending on whether you've pressed the 'left', 'right' or 'fire' key. Lines 1490-1520 Check to see if an enemy fighter has been hit, and then jump to the relevant subroutine. Lines 1900-5000 Check if any of the attackers have reached the bottom of the screen; if they have, your score and shield levels are reduced; if they haven't reached the bottom of the screen yet, each line of fighters is moved down by one row. Lines 5990-6045 Move the laser left, all the while checking to see you're not moving outside the limits set. Lines 6049-6099 Move the laser right, all the while checking to see you're not moving outside the limits set. Lines 6200-6290 Print the laser shots; note that the DRAW command has been used. Lines 6490-6780 This routine notes that a craft has been blown out of the sky, so it's removed from the screen and your score is updated. Lines 7199-7218 Check for high score and calculate the rank you have attained. Lines 7225-7239 Print out a suitable 'high score' message to the jubilant soldier. Lines 7240-7300 This isn't that clever a routine. It's task is to insert the new high score into the table; it does this by moving all those below it down one position. But what happens if you have a ten place 'high score' table? Patrick really should have used a loop here. Lines 7310-7400 This is the message printed up to encourage you to have another go. Trouble is after about 100 games, the machine stack will fill up and the Spectrum will hang up - this is due to a rather nasty piece of programming in lines 7330 and 7340. Lines 7600-7690 Print up the 'high score' table on-screen. Lines 7900-8099 Print up the main screen for the game. Lines 8400-8510 Prepare the screen for the five pages of instructions necessary for the game. Lines 8515-8545 The first screen of instructions is printed up on-screen. Lines 8615-8640 The second screen of instructions is printed up on-screen. Lines 8645-8740 The third screen of instructions is printed up on-screen. Lines 8745-8837 The fourth screen of instructions is printed up on-screen. Lines 8845-8880 The fifth screen of instructions is printed up on-screen. Line 8960 Jump past the 'wait' subroutine. Lines 8965-8970 The 'wait' routine plays a few musical notes while the screen is being read. This isn't the best place for this routine as line 8960 causes the program to jump straight past it; a better place might be just after line 9000. Lines 8990-8995 Contain the 'wait' loop. Lines 9800-9815 Set up the user-defined graphics. Lines 9820-9999 Contain the data for the user-defined graphics. ------------------------------------------------------------------------------ TYPE: Arcade COMMENT: This info file was typed by Jim Grimwood Downloaded from: Desert Island Disks -- http://www.image.dk/~frankie/ Maintained by: Michael Bruhn -- frankie@image.dk