The following article was printed in July 1991 of the magazine „8000 PLUS"
A labyrinth game programmed in BASIC

GRAVITY By Tim Granger, Cambridge

There are many PCW maze games, but most lack a purpose other than escape.
Gravity does not. Your task in the maze is to collect as many precious gems as you can. These are shown on screen by the letter 'O', and are collected by walking into them. You are the blob at the top left of the screen when the game begins, and you move by pressing the cursor keys. There are also small squares in the maze, representing blocks which may prevent you from entering a new corridor. You can get past them only if you have some gems, and each block destroyed costs one gem.
A real gem - Gravity's 'Outrageous' level
Look out for monsters too! They appear as a sort of cross shape, and if you touch them the game ends. A shot, costing three gems, will get rid of them. Move your playing piece in the monster's direction and press [SPACE].
When a maze is drawn, you may be locked in a room. To get out, shoot at one of the walls to turn it into a monster. Shoot him, and he becomes a block. Fortunately, you are given the seven gems needed to get through a wall at the start of the game.
Unlike conventional mazes, this one is drawn on a vertical axis, so here, up really does mean up. The most natural direction in which you can travel is down, and down is exactly where you go if you don't touch any of the other cursor keys. This tendency to fall towards the bottom of the screen is caused by gravity - hence game's name.
There are four levels of play, from 'Easy' to 'Outrageous'. Each skill level is divided into ten levels of increasing difficulty, monsters and blocks, and decreasing numbers of gems. Exit from the current level at bottom right hand corner of the maze. Pressing 'Q' will kill your character and end the game.

The program begins by defining the variables used for the level names, the shape of the walls and the objects. This data is read into arrays in lines 70 to 100
The above section of code introduces you to each new level by displaying the number of gems you have. Lines 140 to 180 work out where the walls will be placed and the up facing arrow at the end of line 200 is produced by pressing [ALT] U
The program looks to the keyboard for input and moves your character in the direction of the cursor key you pressed. If you press Q, the game will end. This section also calculates how many gems you have.
Line 310 kills your character if it runs into a monster and the rest of the section erases and re-displays your character when it moves and records which level you are on
This final piece of code displays your score so far (based on the number of gems you have) and randomly calculates the co-ordinates for the walls
[BASIC-Listing]

Scanned by Werner Cirsovius
December 2004
© 8000 PLUS