New to Spectrum Arcade: Beast of the Tower
Our new 48K and 128K climber: eight worlds of girders and ladders, rolling barrels and a three-phase boss. Here's how we made it.
There's a new cabinet in the Spectrum Arcade. Beast of the Tower is a ladders-and-girders arcade game for the ZX Spectrum 48K and 128K, and it's out now. Play it in your browser in Specz, our emulator, or load the tape on a real Spectrum.
Grimgor the Beast has carried Princess Elowen to the top of his tower, and Toby is going up after them. Between the bottom of the first girder and the top of the tower lie eight worlds: a factory, a jungle, a haunted castle, lava pits, a frozen mountain, a sunken kingdom, a laboratory and the tower itself, with Grimgor waiting on the summit. Below, we explain where the idea came from, the choices we made, how we built and tested it, and how to get to the top. To start, press Play on the cabinet, or open it straight in Specz at spectrumarcade.com/arcade/play.html#tower.
The idea
This one started with a brief from the owner of this site, and a long one. It asked for a classic climbing game in the spirit of Donkey Kong and the golden years of the Spectrum: a hero, a captured princess, a monster at the top throwing things down, and eight different worlds with a boss fight at the end. It also set some firm rules. The villain must not be an ape, the hero must be the one doing the rescuing, and every character, screen and sound had to be our own.
We were happy to follow them. Climbing girders and jumping barrels are ideas anyone can use, but the characters and screens of the arcade original belong to their owners. So Grimgor is a fantasy monster with two curled horns, tusks, pointed ears and angry eyes, coloured purple, red and dark green. Toby wears a red jacket and has spiky hair and a cheeky grin. Elowen has a crown and a long dress. The arcade had flip-screen platformers already, such as Sir Clive's Box of Bits and Apocalypso!, but nothing where you climb a single screen full of ladders while things roll down at you, so the genre was new to us too.
Designing it
Before writing any code we asked the owner a few questions, in two short rounds, so we didn't build the wrong game.
- Format. The brief described a browser game. We offered a real Spectrum tape that plays in the browser through Specz, and the owner chose that.
- Size. Eight worlds full of swimming, ice, lasers and a boss is a lot for a 48K, so each world is one screen. World 8 is two: the tower climb and the summit.
- Machines. Both. The code fits a 48K, and a 128K adds AY music, with a different tune for every world.
- Controls. Everything at once: the cursor keys with Space to jump and Z for the hammer, as the brief asked, plus our usual Q, A, O and P, keys you can redefine, and a Kempston joystick.
- Difficulty. Classic arcade: gentle at first, harder world by world, and after the rescue the whole thing starts again, faster. No continues.
The one-screen choice shaped everything else. Each world had to say something different in a single picture, so we gave every one its own trick. The factory has sloping girders and a conveyor belt. The jungle has a river you cross on a moving branch. The castle hides a key behind a secret door. In the lava pits a bridge gives way a moment after you step on it, the ice on the frozen mountain makes Toby slide, and the sunken kingdom has him swimming with only so much air. In the laboratory Grimgor stops throwing things and comes hunting along the top girder instead.
Building it
Beast of the Tower is written in Z80 assembly and assembled with sjasmplus. It is built on the same small engine as our recent games, which looks after the keys and joystick, the score, the beeper sound effects and the AY music. It never calls the Spectrum's ROM, and it draws its letters with its own font, which is how the arcade can start it instantly without loading a tape at all.
The pictures are drawn as rows of text in a Python script, with a # for each lit pixel, and the script turns them into the data the game uses. Toby's walking frames are each stored ready-shifted to the position they are drawn at, so the game never has to shift a picture while it plays. Grimgor is a big 32 by 32 pixel sprite. The Spectrum can only give each 8 by 8 square one ink colour, which is known as attribute clash, so we coloured him in bands: purple horns, a red head and a dark green body. That way he looks like a monster rather than a block of one colour.
The levels are written in another script as lists of girders, ladders, hazards, items and creatures. The script also checks each one, for example that there is always room for Toby between one girder and the one above it, and that everything sits inside the play area.
The hardest part was memory. With the graphics, the levels and the music, the game was over four kilobytes too big to start where our games usually do. We moved its start lower in memory and split it in two: the code that runs every frame sits up high, where the 48K runs it at full speed, and the title screen, the boss and the level data sit below. It ends up at about 34 kilobytes, which still fits a 48K.
Then there was speed. The game has to finish everything in each fiftieth of a second, about 70,000 processor cycles on a 48K. The first playable version couldn't, even with Toby standing still. We measured where the time went and cut it down step by step. Colours are only redrawn for sprites that have moved to new squares. Enemies take turns to move, half of them each frame, two steps at a time. Grimgor became two sprites, so throwing a barrel only redraws his arms. When it was done, the game had at least 5,600 cycles to spare in every frame of our full test run on the 48K, and more on the 128K.
Testing it
We test every game in Specz's own core, both in its quick start and by loading the tape through the real 48K and 128K ROMs. For this one we wrote a computer player that follows a route through each world and looks ahead: every frame it tries a few moves forward in time against where each barrel, creature and hazard will be, and picks one that stays clear. It found more problems than we expected, and that was the point.
- The river crossing's branch didn't quite reach the far bank, and the lift over the lava left gaps at both ends.
- Chandeliers, icicles and pistons hung low enough to hit Toby just walking underneath.
- The laboratory's laser was longer than its off time allowed you to cross, with a piston right after it, so you could be trapped between the two.
- The spikes in the tower sat under a piston's swing, then one pixel too close to a ladder.
- Skeletons could chase faster than Toby walks, and ghosts followed him up and down so quickly you couldn't jump them.
- Away from the play screen, the routine that reads the keys upset the high-score initials entry and the countdown that starts the attract demo.
We fixed every one. The final check plays a clean game through World 1, then runs the rest of the worlds and the summit with the computer player made invincible to creatures, which proves every layout can be finished and that Grimgor can be beaten. The same run checks the scoring, the ending, the game starting again faster, the high-score table and the attract demo. What we couldn't check is how it sounds and feels on a real Spectrum, or with a real Kempston interface.
How to play
O and P walk, Q and A climb ladders and vines, and Space jumps. Z, or down and fire on a joystick, swings the hammer once you have one. Press down on a thin ledge to drop through it, and up on a switch or a teleport pad to use it. H pauses. Toby can jump up through a girder from below but can't fall through one, and his jump is fixed once he leaves the ground, so judge it before you go.
| Item | What it does |
|---|---|
| Hammer | Swing it to smash barrels and creatures for 300 points |
| Spring | Jumps twice as high for a while |
| Star | For ten seconds, creatures and Grimgor can't hurt you (pistons and hazards still can) |
| Shield | Takes one hit for you |
| Boots | Run faster |
| Heart | An extra life |
Coins are worth 50, gems 200 and chests 500, and most worlds hide a secret, usually a treasure worth 1,000, that appears only when you walk close. Jumping a barrel or a creature scores 100. Clearing a world pays 10 points for every second left on the timer plus 1,000 times the world number, and there is an extra life at 15,000 and every 25,000 after. The best five scores go on a table with your initials.
On the summit Grimgor takes six hits, two in each phase. First he hurls boulders from his perch, then leaps down and pants: that's your moment with the hammer. Next he charges along the floor and crashes into the wall, so climb a ledge and drop onto his head while he's dazed. In the last phase he does both, faster.
- In the factory, barrels sometimes roll down a ladder, more often when you're below it.
- On the ice, start slowing down early.
- Under water, swim up for air, and grab the bubbles.
- In the laboratory, the switch at the far left turns the laser off for good.
Where to play it
Beast of the Tower is in the arcade now, on both the 48K and the 128K. On a phone the on-screen pad has buttons for the hammer and pause. You can read more about the game on its game page, and about how we made our last new game in New to Spectrum Arcade: Wormwood. Then see how high you can climb, and whether you can keep going once the tower starts again, faster.