MOON RESCUE by David Harwood from Games Computing, January 1984 In the year 2020 an exploratory space mission to the far side of the Moon was aborted leaving stranded astronauts with only their backpacks to survive until a rescue team arrived. Your job in this game of skill and daring is to take the part of the rescue team and safely pick up the stranded men from the Moon's surface, at the same time avoiding the many meteors that float above the moon. You must rescue as many men as possible by guiding your spaceship and releasing a ladder from the special "help hatch" to the surface of the Moon. When correctly positioned, the stranded astronauts can climb up the ladder into the safety of the ship. But BE CAREFUL, if the meteors make contact with either the ladder or your rescue ship a massive explosion will blast you to smithereens! Not a happy ending to the rescue mission. Playing the Game To get the game rolling the keys to use are the '1' to move to the right, the '2' to move your ship to the left, '9' to move the ship downwards, '0' to move it upwards, '3' to release the ladder and '4' to make the man climb the ladder. A word of advice, REMEMBER to hold down key '4' until the ship has been reached, and when successfully done you will be serenaded with a well known melody! In total you have three ships to play with and the game ends when all three have been destroyed. One of the game's features is that there is a running total displayed throughout the game. The points system works on the basis of 100 points awarded for each astronaut rescued. For details on the user-defined graphics operation see the program itself. RUNdown Line Action 100 sets colour 105 program initialise 110 sets up user-defined graphics 115 sets up array used for co-ordinates of meteors 123-135 draws Moon surface 140-150 program initialise 155 prints score 160 prints man on Moon surface 165 moves ship depending on key pressed 175 prints ship 180 if the ship is above the man and the '3' key is pressed, goes to routine to print ladder 185 checks to see if ladder is present 195 moves man up ladder 200 detects if man has reached ship or not 205-230 prints meteors and checks if ship is blown up 240-270 routine to print ladder 275 man reaching ship routine 280-290 updates points & returns to main program 295-360 ship blowing up routine. If you have no more ships left, will start playing tune. 365-480 data for user-defined graphics 490 data for meteor co-ordinates 500-520 data for tune for man reaching ship 530 data for music for ship blowing up Conversion Clues Most of the program is self-explanatory, with the variables explaining themselves. Line Action 110 Will need changing to suit your machine's requirements to use the user-defined graphics. 115 Is used to store the co-ordinates of the meteors and, unless your machine has a PRINT AT facility, this line and others incorporating PRINT AT will have to be changed to enable the screen POKEs to work. 135 Uses a system variable 23677, which looks at the co-ordinate of the last X-point plotted. 145 This function of INKEY$ will need to be changed to GET$. 225 ATTR will need to be changed to a screen PEEK. 275 The BEEP will need to be changed to suit your micro's requirements. 490 Co-ordinates of meteors. If you are screen POKEing these will need to be changed. 500-530 DATA for BEEP statements will need to be changed. RUNAWAY ROBOT by Jon Smith and Simon N Goodwin from Games Computing #1, January 1984 Runaway Robot is a fast, original, colour graphics game for any ZX Spectrum. The program has been carefully written so that it is relatively easy to convert for other computers. The year is 2083, and the affairs of the planetary federation are controlled by the massive super-computer SPAM (Seven Planets Administrative Machine). SPAM is so large and intricate that it has to be maintained by a squad of robots which roam its corridors checking for faults and carrying out repairs whenever necessary. SPAM would have to be shut down completely before a human could enter its sealed environment. Unfortunately, one of the maintenance robots has run wild. A fault in its command circuitry means that the robot cannot stop moving at top speed. It is trapped in the middle of the super-computer, careering wildly back and forth, damaging the intricate components which control the economy of seven planets. Already all the Martian income tax records for the last ten years have been scrambled. If further damage occurs interplanetary trade could collapse! You have been rocketed up to the SPAM control centre on Titan (one of Jupiter's moons). It is imperative that you bring the robot under control. Limited command circuits have been established, but it has not been possible to halt the robot. You must steer it away from the heart of the computer before it finally goes haywire and explodes. Playing The Game When you RUN the program it will ask you how many players wish to take part. Type 1 or 2. If you select the two player game, each player will have to bring a different runaway robot under control. The players take turns to guide their robots through sections of the super-computer. Press the "q" key to turn the robot towards the top of the screen; and press "a" to turn it in the opposite direction. Use the "o" and "p" keys to turn the robot left and right. Make sure the CAPS LOCK is not set, otherwise the keys will not be recognised. You can alter them if you wish by substituting different characters in line 140. Scattered between the wiring-banks of SPAM you will find purple storage cells - batteries for the maintenance robots. These restore the energy supply, making it possible for you to move the robot further from the critical parts of the super- computer. You cannot leave a section of SPAM until you have collected all the batteries in it. As the game goes on you will move into increasingly complex parts of the super-computer. There are more batteries in the outer sections, but the wiring pattern is more dense so you must take extra care to avoid damaging SPAM. Each time the runaway robot collides with the circuitry it loses energy. When the energy (shown at the bottom of the screen) reaches zero the robot will explode ... Hints On Play As the game progresses the wiring inside the computer will become more and more complex, but there will always be a route to each of the storage cells. There are 30 different 'levels' of wiring. At high levels the number of batteries is increased as well as the cost of collisions and the complexity of the maze. It is easy to overshoot junctions unless you control the robot carefully. If you press the required key just before the robot reaches a turning you will not overshoot. Once your robot has crashed it goes out of control, bouncing randomly back and forth until you steer it away from the obstruction. Take control again quickly or the robot will destroy itself. The key to playing Runaway Robot well is choosing the best possible route through the circuitry of SPAM. Try to select the shortest possible path between the storage cells. To do this you should look around the design as you move, constantly planning ahead. The robot uses up energy every time it changes direction. There are two times at which you can study the circuitry without having to control the robot at the same time. Before you move through each section of the computer you will see the wiring build up on the screen. Once the complete section is drawn the storage cells are positioned, and a fanfare sounds. You then have four seconds in which to study the wiring before the robot starts to move. If you don't need this time then you can start immediately by pressing a direction key. Summing Up The heart of Runaway Robot is the random circuit generator, which produces an almost infinite number of different mazes. In each maze you are guaranteed that a path will exist between every point, so you can never end up 'trapped', however complicated the maze is. The random circuit generator can be used to produce mazes in any other game you care to design. It uses simple graphics (a corner, horizontal and vertical lines), and requires a minimum graphics resolution of only 31 by 21, so it should run with few changes on almost any computer. The Solar System is counting on you. The Interplanetary Revenue Service will reward you if you can save their records from destruction. What right-thinking sentient being could resist such a challenge? RUNdown Lines Action 100 The main program starts at line 200. The two most often used subroutines have been entered at the beginning of the listing so that they can be found quickly by BASIC. The game would be slower if they were at the end of the program. 110-160 Read the Spectrum keyboard. If a direction key is pressed return with the direction number (1 to 4) stored in 'direction'. If no key is pressed, keep the old direction. 170-190 Draw a 'star' (circuit junction) in the odd-numbered row and column specified by 'x' and 'y'. 200-280 Set up the program and then play the game over and over again for each player. 290-300 Store the most commonly-used values in variables. This makes the program slightly shorter, but it is not necessary unless you plan to add large amounts of extra code. 310-320 Tell the computer the size of the screen, in rows (Y) and columns (X). 330 Reserve space so that the details of two players can be stored. 340 Stop the Spectrum keyboard auto-repeat (this speeds up the game). 350-400 Set up two arrays which determine the relationship between 'direction' and X and Y coordinates. Store the graphics for the robot in each direction (right, down, left, up) in E$. 410-500 Define the graphics for the batteries and circuitry. 510-600 Let the user select a one or two player game. Put the starting energy into E(), the level into L(), and the score into S(). 610-620 Let one player play. Fetch the results so far. If it is a two player game then say who is to play next. 630 Call up the parts of the program which do the real work! 640-650 Save the results so far and return. 660-670 Work out how many times you must fail to place a connection before you decide that the circuit is 'complete'. 680-690 Clear the screen to a white area 31 printing positions across by 21 down. 700-780 Draw wiring between random points until the circuit is complete. 790-800 Join junctions with a horizontal line (character 146) or a vertical line (character 147) depending upon the direction. 810-830 Move on, unless the edge of the screen has been reached or the next point is an existing junction. 840-870 Carry on selecting new directions, but don't go back the way you came. 880-890 Record that more wiring has been placed. If the section is not complete then try to lay another wire. 900-930 Prepare to play the game. 940-990 Position batteries (character 144) randomly. The higher the value of 'skill' the more batteries appear. 1000 Draw the robot at the start. 1010 Record how many batteries must be found. 1020 Print the scores so far. 1030 Fanfare and wait for four seconds. 1040-1050 Read the keys and prepare for movement. 1060-1080 See if we have hit a wall or a battery. 1090 Move the robot. If all the batteries have gone then stop. 1100 Read the keys. Move on unless they have changed. 1110-1120 Lose energy if the robot has turned, then move again. 1130-1150 If a wall has been hit then punish the player accordingly. 1160 Increase energy - battery found. 1170-1190 Section cleared - play a jingle. 1200-1210 Update scores. 1220 The runaway robot will run no further ... 1230-1260 Show final score. 1270-1330 End of game. Show both scores and request another game. 1340-1370 Time delay. Conversion Clues Runaway Robot is not a difficult game to convert to run on a different computer, as long as the machine allows you to position characters on a 31 column by 21 row area. There are only three POKEs in the program - these should be missed out on computers other than the Spectrum. You will have to replace the Spectrum user-defined graphics with your own, so omit lines 410-490. Characters are positioned on the Spectrum display using the PRINT AT Y,X;CHR$(N); statement. This positions character N at row Y, column X. Coordinate 0,0 is the top left hand corner of the display. In the program the following special (user-defined) characters are used: CHR$(144) Battery. CHR$(145) Junction. CHR$(146) Horizontal line. CHR$(147) Vertical line. CHR$(148) Robot facing left. CHR$(149) Robot facing right. CHR$(150) Robot facing vertically. For example, the statement PRINT AT 31,1;"!"; would position an exclamation mark at the right-hand end of the second lines of the display. [No, it wouldn't, it would give a "B Integer out of range" error; it should be PRINT AT 1,31;"!". JimG] The Spectrum does not have a convenient facility for identifying user-defined graphics once they have been printed, so the ATTR(Y,X) function is used to find the colour at a given character position. ATTR(Y,X) is 56 if the character at position Y,X is wiring, and 59 if the character is a battery. The game uses the Spectrum's INK, PAPER and BORDER statements to select colours. In fact it will work (in principle) in black and white, so long as ATTR is replaced by a function which describes the character at a given place on the screen. The INK, PAPER and BORDER statements should, consequently, be omitted. Likewise, the BEEP statements, used for sound effects, are only needed on a Spectrum. You may replace them with the equivalent command on your computer, but the program will still work if they are absent. Once you have converted the game as written it is possible to increase the size of the circuits generated, so that the whole of your display area is used. Alter the X and Y values in lines 310 and 320 to change the size of circuits. The number of columns is stored in 'sxmax' and the number of rows is in 'symax'. Both values must be even. The CODE function is the equivalent of ASC in other versions of BASIC - it returns the ASCII code of a character. INKEY$ returns a single character if a key is pressed - otherwise it returns an empty string (""). The CLS command clears the display. Armed with all that useful information to help you play this great game, you're bound to have the time of your life. So go out and get those robots!