Personal Computer News


Pot Hole

 
Published in Personal Computer News #047

Pot Hole

Lunar Lander is an old, old game that comes on micros ancient and modern. Well here it is again, but before you start groaning, this version is almost completely unrecognisable from the original as it has been revamped and upgraded to the form printed here.

Nicholas Hewitt of Ayrshire, Scotland, has used the graphics capabilities of the Dragon 32 to good effect and produced a game not as easy to finish as might appear at first sight.

You take the part of Captain Pilot of The Fleet of six ships. You are responsible for landing your fleet without pranging any, well not too many, of your ships. Steering is done either with the keyboard, using the right and left arrow keys, or by the judicious use of a joystick. Control over the amount of thrust coming out of the back of the ship is by use of the up arrow key or by pushing the joystick forward.

The game originally used the speed up POKE, in line 40, this was 40 POKE &HFFD7,0. Unfortunately the PCN Dragon is one of the permanently slow kind and this POKE just crashed the machine, so line 40 was removed.

If your machine will go fast, put the POKE back into the program, otherwise either play the game a little more slowly or increase the amounts added and subtracted from X in lines 1480, 1500, 1590 and 1600, increase the value of V in line 250 and the amount subtracted from D in lines 1520, 1620.

Finally, when the game is first run, the high-resolution screen will be full of rubbish. To make the game run properly just follow the prompts; i.e. press a key to play the game.

Program Notes

40 Put speed up POKE in line 40 if applicable. Note this won't work on some Dragons
60 Reserve space for strings and set the top of the memory pointer
70 Set up variables and dimension arrays
80-110 Clear the screen and print option. Get, and act on, the response
120-160 Print message about joysticks and wait for a key to be pressed
170-240 Read and POKE the machine code data into the memory from &H7000
250-260 Set up some variables and clear the screen
270 Gosub and print the instructions
280 Clear the high-resolution screen to background colour 2
290-420 Draw the spacecraft, the bust spacecraft and the equivalent background square and copy them into the appropriate arrays for later use
430 Clear the screen back to colour 2
440 Select a random playing screen (and check that it's not the previous one)
450 Put the present screen number into RS
460-470 Jump the appropriate screen drawing routine
480-760 Draw screen 0
770-1080 Draw screen 1
1090-1300 Draw screen 2
1310-1320 Prompt to begin the game
1330 Select screen mode
1340 Check for hitting a rock
1350 Get the colours of the positions of the landing feet of the space craft
1360 Check that they are both on the pad
1370 Check whether the craft has returned to the top left hand corner after landing six craft and if so restart the game
1380 If joysticks were selected, jump to the routine that deals with them
1420-1440 If the up arrow key has been pressed then alter the upward velocity
1450 Rub out the space craft and alter the vertical position by the distance value D
1460-1480 Check the left arrow key and if pressed update the horizontal position
1490-1500 Do the same for the right arrow key
1510 Print the space craft at the new position
1520 Increase the falling velocity to simulate gravity. To make the game a little more exciting, increase the amount added to D. The maximum downward speed is 30
1530 Continue the game
1560 Read the vertical position of the joystick and update the velocity accordingly
1570 Same as line 1450
1580 Stop the spacecraft from going off the screen
1590 Same as lines 1470-1480 but for the joystick
1600 Same as lines 1490-1500 but for the joystick
1610 Print the spacecraft at the new position
1620 Update the velocity as in 1520
1630 Continue the game
1640-1710 Print the score and prompt for another game
1720-1880 Print the instructions for playing the game
1890 Landing subroutine. Repaint the landing pad and put the spacecraft just above it; update the number of landings
1900 Reprint the spacecraft
1910 Play the landing tune
1920 Rub out the spacecraft
1930 Check landing speed and if too great then gosub to the crash routine
1940 If speed greater than ten then it was a hard landing
1960 Crash subroutine print the crashed spaceship picture on the screen
1970 Play crash tune
1980 Rub out the crash picture
1990 Reset the position of the spaceship and check the number of ships is greater than zero
Pot Hole Illustraion

Nicholas Hewitt