1983 · Quicksilva

Ant Attack

This minisite was contributed by air. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/spectrum/ant-attack with me to Gold.

The giant ants are stored in the city map as blocks, the same as the walls. That is why an ant can block your way, bite you, and lift you onto its back.

The game

Ant Attack came out for the ZX Spectrum in 1983. Sandy White wrote almost all of the program on paper and turned it into machine code by hand. The game shows a walled city in 3D, seen from above at an angle. You can walk, jump, and climb on the blocks, and you can turn the view to see behind the walls.

You choose to play the boy or the girl. Ant Attack was one of the first games to give players that choice. The other person is trapped somewhere in the city of Antescher. Find them, then lead them out through the city walls before the clock reaches zero.

Giant ants hunt you both. You have twenty grenades, and a grenade can kill ants. It can also kill you or the person you came to save. If you jump down onto an ant, it freezes.

There are no lives. If you or the other person dies, you start again at the gate. The clock does not go back to the start, so each death costs you time. The game ends when the clock reaches zero, or after ten rescues.

Ant Attack title and character selection
The title asks who you want to play. The logo is drawn again in each of the eight colours, five times over, with a beep each time.
The player at the entrance of Antescher
Every rescue starts at the gate. The SCAN box helps you find the other person.

You walk with V, turn with M and Symbol Shift, and jump with C. Hold V and C together to climb onto a block. The keys 0, P, Enter, and Space choose one of four views. S, D, F, and G throw a grenade a short or a long way.

The city is one map of block columns

The whole city is one map, 128 squares by 128. Each square is one byte. Six bits of that byte say if there is a block at each of six heights. Each height has its own bit, so a column can have a gap in it. That is how the city has arches and overhangs as well as solid walls.

In Plan view, click a square to see its six bits.

The red marker shows where the other person waits. Rescue 1 always uses the same place. Each later rescue uses one of four places. The Map tab shows all of them. This viewer draws plain faces so that you can see the columns. The game draws its walls with dot patterns.

The block test is at $8920. The camera reads the columns at $8380.

What the game says to you

Ant Attack talks to you a lot. The BASIC part of the program tells a short story between rescues. During play, the machine code prints short messages over the city. Each message plays its own beeps, and some flash the whole view in colour. Press Listen on a card to hear it.

Before each rescue

Welcome to Ant Attack screen with the opening story
WELCOME TO ....Before rescue 1, the game sets the scene. It calls you a HERO, whether you play the boy or the girl.
Score card after the first rescue
**** SCORE CARD ****From rescue 2 on, a score card shows how you are doing, with a new line of the story under it.

These are the lines for rescues 2 to 10, with the game's own spelling and spacing.

Rescue 2Well done,but that was easy. Now there's someone else to save !
Rescue 3So far so good. On your feet once more... no time for a coffee break !
Rescue 4Are you brave enough to try again ? DONT WASTE TOO MUCH TIME THINKING!
Rescue 5You have a brave heart ... Better use your BRAIN from now on too !!!!
Rescue 6Survival of the fittest !! Are you fit enough to survive ? Then PROVE IT !!!
Rescue 7You handled that well. It must have been too easy.. Try again !
Rescue 8Who would have thought you could get so far ? Better not be silly now !
Rescue 9Although you are weak , you cannot give up while human life is in peril !!
Rescue 10There is only one person left in the city. Your mission will soon be accomplished.. IF you live !

During play

MY HERO! and TAKE ME AWAY FROM ALL THIS! in red over the city
"MY HERO!"You found the other person. They say this whether you play the boy or the girl, and then they follow you.
BITTEN! on a yellow bar
BITTEN!An ant walked into your square. You lose one of your 20 health points.
THEY GOT ME on a yellow bar at the top of the view
"THEY GOT ME"An ant bit the other person. They have 20 health points too.
EATEN ALIVE on a cyan bar
EATEN ALIVEYour last health point is gone. You start again at the gate.
IVE BEEN EATEN ALIVE on a cyan bar
IVE BEEN EATEN ALIVEThe other person's last health point is gone. You start again too.
NASTY FALL ! under the city view
NASTY FALL !You fell a long way. You lie still for several seconds, but you lose no health.
HELP! I FELL! under the city view
"HELP! I FELL!"The other person fell a long way.
GOOD SHOT! with the view in white on black
GOOD SHOT!Your grenade killed an ant. The view changes colour halfway through the word, so GO loses its red.
PARALYSED AN ANT ! on a yellow bar
PARALYSED AN ANT !You jumped down onto an ant. It freezes where it stands.
SILLY! YOU BLEW YOURSELF UP ! in red
SILLY! YOU BLEW YOURSELF UP !Your own grenade went off in your square.
HOW COULD YOU ? AFTER ALL WE'VE BEEN THROUGH ? on cyan
" HOW COULD YOU ? AFTER ALL WE'VE BEEN THROUGH ?"Your grenade killed the person you came to save.
CONGRATULATIONS ! in several colours
CONGRATULATIONS !You both got out of the city. The letters change colour as they appear. Then the whole view steps through six colours, one for each note, and is left flashing.

Two more sounds have no words:

When it ends

Have another go! flashing over the city
Have another go!You or the other person died, or you pressed 1. You start again at the gate, and the clock keeps running.
TIME UP! screen: TOO BAD SLOWCOACH ! YOU RAN OUT OF TIME !
TOO BAD SLOWCOACH !The clock reached zero. This is the only way to lose. The screen shows how many lives you saved, and then a run of beeps falls in pitch.
YOU ARE A REAL HERO in large red blocks
YOU ARE A REAL HEROAfter the tenth rescue, the word HERO builds itself one block at a time, in a jumbled order, with a note for each block.
A red medal on a chain: TEN LIVES SAVED, Please accept this SOLID GOLD medal
Please accept this SOLID GOLD medal !Then BASIC draws a medal on a chain. The chain is red, so every letter it crosses turns red too: the Spectrum gives each 8 by 8 square only one ink colour.

The messages are stored from $9000. The routine at $8E0D prints them a byte at a time. Letters and colour codes go to the Spectrum's own print routine. A byte from 128 up plays a beep or a burst of noise, and one more code paints the whole view in a new colour. That code is why GOOD SHOT! has two colours. The story lines and the end screens are in the BASIC program, at lines 1000 to 1090 and 3200 to 3630.

Get within three squares, and the other person follows you

The other person waits in one place until you find them. You find them when you are three squares away or closer, at the same height. The game counts squares along the streets, so a diagonal square is two squares away.

Use the buttons or the arrow keys. The shaded squares are close enough to find someone. The other person is hidden until you find them.

The SCAN box does not point the way. It only says warmer or colder. Every turn, the game compares your distance with the distance one turn before. The box turns green if you got closer. It turns red if you did not, and that includes standing still. After you find the other person, the box stays red.

Once found, the other person says "MY HERO!" and follows you. What they do depends on how far away you are.

You1 square: stops next to you2 to 5 squares: walks to you6 squares or more: waits

So if you climb where the other person cannot follow, and get six squares away, they wait for you. Come back within five squares, and they follow again.

The test that finds the other person is at $8F80. The SCAN box is painted at $87D0. Following is at $8AB6.

An ant only checks if each step brought it closer

An ant does not look for a path to you. Each turn, it takes one step forward. Then it asks one question: am I closer to you now?

YouAntStep got closerStep did not, so the ant turnedWallUnder a roof

A piece of the city at ground level, with the five ants where they start. Click or tap a street to move yourself there. Ant 1 is the fast one.

Each ant is stored in the city map as a block at ground level. So you cannot walk through an ant, and you can stand on one. When an ant steps into your square, the game finds a block where you stand. That is a bite. You lose one health point, and you rise onto the ant's back.

Ants cannot step up onto a block, so they stay on the ground. While you stand on a block, an ant on the ground cannot reach you.

Most ants skip every other turn. After rescue 4 they move on two turns in three, and after rescue 8 on three turns in four. Ant 1 is different. It moves on 19 turns in 20, from the first rescue. Discoveries has more.

A grenade kills ants up to four squares from the blast, and it stops ants five to seven squares away for a short time. The ant must be at the same height as the blast. A dead ant comes back where the ants started, a few turns later.

An ant's step is at $8A00. The test that skips some turns is at $8A5D. A blast is checked at $87A0.

Later rescues are worth more

A rescue scores the time left on the clock, times the number of the rescue. The clock starts at 1,000 for each rescue. So 500 left on rescue 10 is worth 5,000 points.

The clock goes down by one every third game turn. A turn takes longer when the view has more to draw, so the clock does not count seconds. The time left also chooses where the next person waits: the game divides it by four and uses the remainder.

BASIC line 90 at $5E49 adds the score. The clock is at $8DD0.

How the picture reaches the screen

The game draws the city into a buffer, one row after the next. The Spectrum's screen does not keep its rows in that order. So a copy routine at $8100 moves each row to its place on the screen. Before that, $8500 merges the people and ants with the walls by depth, so a wall can hide a person.

The screen just before play starts. READY WHEN YOU ARE uses the Spectrum's FLASH colour. The machine swaps the ink and paper of those squares every 16 frames, about three times a second.

Further reading

Discoveries has the fast ant and the fifteen grenade fuses. The Source code tab has the whole program with notes.

References: original instructions, CRASH’s review from the time, and Wikipedia.