Ocean Defence - Danny Sheehan (Your Spectrum-No.9-Page 75) In time of war, it's not only those who rule the waves that come out on top it's also those who can rule beneath the waves as well! Mighty as your warship may look, it'll take all the skill you've got to hand to sort out the submarines skulking around underwater readying themselves to launch missiles against your home base. The instructions for play are very simple, it's just difficult to get your timing right so that your depth charges actually hit home. Your ship moves across the top of the screen from left to right at a set speed, but you can double this speed using keys '6' to '0'. Launching a depth charge is done with keys '1' to '5'. Once you've dropped a depth charge, however, don't press the keys again until you're sure that it's a gonner as you can only have one depth charge on-screen at any one time. The game as it stands has two levels - Cadet level provides you with 55 depth charges, and nine missiles are all that are needed to destroy your home base. Admiral level gives you 44 depth charges and here only six missiles let through your defences will finish off your base. A third or fourth level can be added to the program by altering the initial values of the number of ships (you are given three only in the game given here), depth charges (line 40), and the total number of missiles needed to destroy your home base (line 920). To make the missiles more or less frequent try altering the values in line 1615. The program is in three parts - machine code, Basic and data for the user-defined graphics. First of all, you should enter the machine code loader program, RUN it and then delete all of the lines except for line 1. Now enter the Basic program, type RUN 7000 and enter the data given for the user-defined graphics. The program is now complete and can be SAVEd to tape by typing RUN 8000. You'll find that the finished program is saved in two parts: the Basic and machine code, followed by the data for the user-defined graphics. Line 10 Sets the Caps lock on the keyboard and the GO SUBs to the routine that prints up the title page of the game's instructions on-screen. Lines 20-200 Set up the main variables for a new game (lines 20-40), for a new level (lines 60-90) and for when one of your ships is lost (lines 130-200). Lines 600-790 The main program loop. This prints the submarines and you ship on-screen and calls the necessary subroutines required from the rest of the program to move them. Lines 690-710 move the submarines left and right. Lines 800-830 This subroutine prints the ship - if double speed is required, it's called twice. Lines 900-930 Prints the necessary scoring information on-screen, such as the number of missiles exploded (lost) and how many depth charges you've left on-board. Lines 1000-1040 Set up the position of each drop of a depth charge. Lines 1100-1160 Print the falling depth charge and check for contact (a hit) with a submarine using the SCREEN$ function. Lines 1400-1470 This routine is called when a depth charge has hit one of the missiles fired by a submarine. Lines 1500-1570 This routine is called when one of your depth charges has successfully hit one of the submarines. Line 1530 blanks out the submarine from the relevant string array. Lines 1600-1650 Check to see if a missile will be fired from one of the submarines. Lines 1700-1740 Print the missile being fired from a submarine on its upward path towards your ship. Lines 1800-1840 Alter the PAPER colour of the missile when it breaks the surface of the water. Lines 1900-1920 This routine check to see if one of the missiles has escaped the ship's detection, and if so determines that it has hit your home base. Lines 2000-2030 Should you complete your mission, you are told so on-screen and line 2010 uses machine code to produce a flashy screen display to emphasise your success. Lines 2100-2140 This routine determines what happens when one of your ships is destroyed by one of the submarine's missiles. Again, machine code is employed to liven things up a little. Lines 3000-3300 This routine prints the 'end of game' table giving the player full details of the mission. The actual percentage score is calculated from several factors: score (40%), hit/miss ratio (20%), how many missiles hit your home base (20%) and how far you progressed with the game (20%). Line 3290 prints up whether the mission was successful overall or not. Lines 4000-4150 This routine prints up the title page on-screen and asks you to select which of the two skill levels you require. You'll also be treated to a tune of sorts while the Spectrum awaits your decision. Lines 7000-7070 This routine allows the data for the user-defined graphics to be entered. Change the value of B in line 7005 if you want to edit the machine code given in any way. Lines 8000-8040 This routine is given to allow the user-defined graphics data to be loaded in after the Basic program. [As the m/c loader is not included in the final program I've included ] [it here for reference - including the rather important line ] [ 30 POKE n,a which was missing from the magazine listing. jimg.] 1 REM 01234567890123456789012345678901234567890123456789 (40 characters) 5 LET b=0: REM zero checksum 10 FOR n=23760 TO 23799 20 READ a 30 POKE n,a 40 LET b=b+a: NEXT n 50 IF b=5302 THEN PRINT "MC ACCEPTED" 60 IF b<>5302 THEN PRINT "MC INCORRECT" 70 DATA 06,80,05,120,254,0,32,250,201,38,10,62,255,211,254,205,208,92,62,01,211,254,205,208,92,37,124,254,0,32,236,201,62,30,211,254,61,32,251,201 ------------------------------------------------------------------------------ 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