
RED ANTS
by Carlo Delhez for 16K Sinclair ZX81
from Your Computer vol.4,#11 (Nov.1984)


THIS GAME MAKES full use of the capabilities of your ZX-81: it consumes
the entire 16K RAM and gives fast, smooth and impressive action-
graphics during the play.

The game is set in an enormous ants nest, measuring more than eleven
times the size of the screen. The top of the maze is a long corridor -
at ground level - from which lots of galleries are dug into the earth,
all coming to a dead end sooner or later after being split up several
times. The ants-nest maze has no exit. Each time you start a new game, a
new nest will be "dug"; this takes some five seconds.

Sixteen ants walk through the nest while laying their eggs. It's your
mission to collect as many eggs as possible, while watching out for
these awful ants: they do not chase you, but as the game progresses they
run faster and faster, which makes avoiding them increasingly difficult.

You need imagination, patience, quick reactions, persistence and, of
course, a supply of luck to play this game. But these abilities are also
needed when entering the program. So, brace yourself!

The program consists of 3355 bytes [of] machine code, stored in one
large REM, and 1786 bytes Basic. The rest of the RAM will be filled by
variables.

Entering the machine code is the toughest part. First, clear your ZX-81
by typing:
	RAND USR 0

Second, space needs to be reserved for the machine code. Enter a line 1
REM followed by 128 characters - ie. four full lines. Then, edit this
line 23 times to get lines 2 up to 24 inclusive. Finally, edit line 24,
change to 25 and add five characters. By now 3355 bytes should be
reserved. Verify this by:
	PRINT PEEK 16396+256*PEEK 16397-16509
If a number other than 3355 is printed, you must start all over again.

Third, enter the hex-loader - program 1. Before running the hex-loader,
enter subjoined Pokes as direct commands.
	POKE 16510,0
	POKE 16511,23
	POKE 16512,13
	POKE 16514,118
	POKE 16515,118
These Pokes will convert the 25 REM lines to one large REM statement,
stored in line 0. LIST will only show:
	0 REM
LIST 1 will show the rest of the program. Now Run the hex-loader.

It expects two inputs - the start address and the finish address. Enter
16514 for the start. If you intend to type in the entire program in one
go enter 19863, but if you prefer to type it in over several sessions
enter a lower figure, save the code you have already typed and when you
resume typing start up where you finished previously.

* Enter Code; press E. Type the starting address in decimal. Now you can
enter a string of hexadecimal numbers. If the program finds anything
wrong in this input, the screen will be cleared, the address where
things went wrong is displayed, and a new input asked. Enter a single Q
to quit and return to the main menu.

* Check Code; press C. Enter the starting address in decimal. The screen
will then be filled with the hexadecimal address contents from this
address onwards. Pressing Q during the printing or after a screen-fill
will return to the main menu. Pressing any other key after a screen-fill
will show the contents of the next 168 addresses.

* Save Code; press S. The program will be Saved. It is best to repeat
this several times while entering the code, in case the final version
won't Load properly.

If everything has been entered correctly, delete the hex-loader and make
a few tape copies of the code. When you have reached this stage, you are
very near the finish. Just a little more patience ...

The final stage is to enter a small Basic program. Don't make mistakes,
especially don't be mistaken with addresses preceded by USR and POKE.

You will find that space saving techniques, like the use of VAL, have
been applied. These are really necessary, so do not omit them or the
program won't run properly.

By now, you have reached the end. First Save the program by:
	SAVE "RA*BACK-UP"
and then
	RUN

The program will be Saved once again and then the long awaited result.
If now, or at any other stage later on, a crash occurs reload the
program containing both the complete REM with machine code and the
hex-loader, and re-check the code. If you cannot find an error, reload
the back-up copy by:
	LOAD "RA*BACK-UP"
and check the Basic program, in which you should find the error.

Let's hope you did not come across a crash. Press Y to get instructions.
Read them carefully. If you think the instructions scroll up too fast or
too slow, break out directly after the instructions, when "press any
key" occurs, and change the number Poked in line 110. A number higher
than 160 will make them go slower, a number less than 160 will speed
them up. Run again by:
	RUN 10

If you have read the instructions, you are asked to press a key, after
which the starting temperature can be adjusted. To do this, press 8 to
increase or 5 to decrease the temperature. If the correct temperature
has been gained, press Newline. A temperature of less than 22 degrees
makes the ants move slower than you, at 22 degrees, they move at the
same speed as you, and a temperature of more than 22 degrees will make
them move faster than you do. At 30 degrees, the game is hardly
playable. You'd better start with 0 degrees.

When the temperature has been adjusted, a message appears to say the
game will start within five seconds. During this period, the ants nest
is "dug". It's advisable to press the F key during this period and to
keep it pressed, for when the game starts, there will be no action at
all until you release the key. So, keep F pressed.

Now you will see the ants nest. Three quarters of the screen is blank:
this is the outside of the maze. One quarter, in the bottom right-hand
corner, shows a maze. In the top left-hand corner of this maze - the
middle of the screen - you see an asterisk - that's you. A few lines
underneath you, there's a nought - that's an ant. Take your finger off
the key for a short moment; the ant will move and leave full stops
behind it - these are the eggs. Now you can release the F key and start
walking. Use the keys: I = up; Z = left; C = right; M = down.

Begin by pressing C for some moments. You will see that you keep steady,
while the maze moves to the left. When you eat the first egg, you will
see some bars running across the screen. This also happens every 1000
points. The ants will then speed up.

If you get bitten, you'll see this three times in succession and you
will be repositioned in the top left-hand corner of the maze. The ants
will then slow down. After being bitten three times, a nice "Game Over"
appears. Press any key to start all over again.

Finally, here are a few useful hints concerning some possible
alterations.

If you do not like the key combinations for steering, or there is a need
for other keys in order to use a certain joystick, you can easily alter
the keys for movement. This is done as follows:

POKE 18664 )
POKE 18712 > Code of character Up
POKE 19834 )

POKE 18669 )
           > Code of character Left
POKE 19852 )

POKE 18681 )
           > Code of character Right
POKE 19825 )

POKE 18695 )
           > Code of character Down
POKE 19843 )

Not only has the steering been changed by these Pokes, but the
instructions have also been altered accordingly.

The hi-score is stored at the address 17046 up to 17051 inclusive. You
can POKE in some hi-score or reset it to zero. Resetting to zero,
however, can just as well be done by reloading the program.

If you are satisfied with the program, and you do not want to change it
any more, it can be made break-proof. This means that, if you try to
break while the computer executes a Basic line, this interrupt-driven
routine will respond with the execution of a RST 0, ie. a full
system-reset. To achieve this, edit line 10 and change the PEEK into
USR. Now RUN, record on tape and try to press Break. There will not be
much program left if the cursor reappears. This is a very good
protection against burglary.

I am fully aware of the fact that typing this program is anything but a
pleasant occupation. Therefore, I can supply you with a good quality
tape version. To obtain such a tape, send #3 to Carlo Delhez [address
removed].


--
Another Fine Product transcribed by:
Jim Grimwood, Weardale, England
http://www.users.globalnet.co.uk/~jg27paw4/
--
