New to Spectrum Arcade: A Bit of Blighty
Our first pinball table, and the first game a visitor asked us for: dig up the Kraken's treasure on the voyage home to Blighty. Here's how we made it.
There's a new cabinet in the Spectrum Arcade, and it's a first for us in two ways. A Bit of Blighty is our first pinball game, and it's the first game a visitor asked us to make. It runs on 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.
The game was requested by Moshed through our Request a Game page, with a pitch of a fast high-seas adventure, the curse of a sea monster and the reward of hidden treasure. Below, we explain how that pitch became a pinball table, the choices we made, how we built and tested it, and how to get the Kraken's hoard. To start, press Play on the cabinet, or open it straight in Specz at spectrumarcade.com/arcade/play.html#blighty.
The idea
Most of our games start with us looking at what the arcade lacks. This one started with someone else's answers. Moshed filled in the same design questions we normally ask ourselves: the genre, the theme and the hero, which machines, the controls, how hard it should be, the sound and the extras. The genre was pinball, the theme a pirate ship with a sea monster and plenty of hidden treasure, and the working title was A Bit of Blighty. Blighty is old British slang for home, so we read the title as the voyage home, with a hold full of treasure if the monster lets you get there.
Before using a title we check that nobody else has a game of that name. We couldn't find one, so the requester's title stayed. The rules of pinball are free for anyone to use, but real tables' layouts, artwork and names aren't, so everything on our table is our own: the Kraken, the oar flippers, the powder kegs, the treasure map and the eight seas.
Pinball also suits the Spectrum better than you might think. A table is one screen that never scrolls, the ball is small, and the interesting parts are physics and timing rather than lots of moving sprites. The hard part is making a ball that bounces convincingly, and that turned out to be most of the work.
Designing it
Because the requester had answered every question, we didn't have to ask any. Their choices were:
- Genre. Pinball, a genre the arcade didn't have.
- Theme. A pirate-ship table, a sea monster and hidden treasure.
- Machines. Both, with the code fitting a 48K and AY music on a 128K.
- Controls. Our usual set: Q, A, O and P plus Space, keys you can redefine, the cursor keys and a Kempston joystick.
- Difficulty. Classic arcade, with the speed and the number of enemies going up.
- Extras. A loading screen, a high score, lives, levels and an attract demo on the title screen.
Turning those answers into a table meant deciding what the monster and the treasure actually do. The monster became the Kraken. Its head sits at the top of the table under the arch, and its mouth is a target: shoot the ball in and the Kraken bites, scores you a bonus and spits the ball back out. Its tentacles are the enemies the brief asked for. They sweep left and right across the table and whack the ball wherever they meet it. There's one in the first sea and four by the last.
The treasure became five hidden spots in every sea. Roll the ball over one and it's dug up. Finding them by luck alone would be slow, so we added three drop targets on the left wall, M, A and P. Knock all three down and the treasure map shows an X on every spot that's still hidden, for fifteen seconds. Once all five treasures are found, the Kraken's mouth opens and flashes, and a shot into it now wins the hoard and sails you on to the next sea. That gives each sea a goal, which the brief's levels needed, and makes the curse and the reward part of the same story.
The levels are eight seas, from Tortuga to Blighty itself. Every sea moves the treasure, adds tentacles and makes the ball heavier, so it falls faster. That's the "speed and more enemies" from the brief.
Building it
Like every game in the arcade, A Bit of Blighty is written in Z80 machine code and assembled with sjasmplus. It's built on the shared engine we use for all our new games, which looks after the controls, the score and the sound.
The ball is a single point that moves in four small steps every frame, with its position and speed kept in fractions of a pixel. The table around it is the clever part. A Python program draws the table from simple shapes: the hull walls, the arch, the Kraken's head, the kegs, the slingshots and the targets. From the same shapes it builds a collision map. Every two-by-two pixel cell near something solid records which way is out and what the solid thing is. The walls are fattened by the ball's radius, so the game only has to ask whether the ball's centre is in a solid cell. When it is, the ball's speed is reflected off the surface, with a little lost or, for a keg or a slingshot, a kick added, and the ball is nudged back out.
The oars needed their own maps, one for each of five angles, with each cell also recording how far along the oar it is. An oar swings up in a single frame. If it sweeps into the ball, the ball is knocked away at the speed that part of the oar is moving, faster near the tip. That's what lets you aim: meet the ball early and it flies across the table, meet it late and it goes straight up.
The colours come with the usual Spectrum catch. Each eight-by-eight cell of the screen can show only two colours, so anything moving takes on the colour of the cell it's in, which is called attribute clash. We kept it tidy by keeping the table mostly one bright blue sea and giving the tentacles their own green lanes of empty water, so the ball only changes colour as it crosses them.
All the graphics are drawn as ASCII art and pictures in Python, which writes them out as data the game can use: the font, the ball, the tentacles, the coins and X marks, the oars at every angle, the plunger at every pull, the title picture and the loading screen with Moshed's credit on it. The table and title pictures are squashed with a simple compression scheme and unpacked when they're needed, so the whole game fits in about 23 KB.
On a 48K, the sound comes from the beeper: clicks for the oars, booms for the kegs, a chime for treasure and a growl for the Kraken. On a 128K the AY chip plays a jig on the title and a shanty in play that gets higher and quicker in each sea. You can read more about the difference in Beeper vs AY music.
Every frame has to fit in a fiftieth of a second. Even on the last sea, with four tentacles and a busy ball, the busiest frame we measured still had about 9,500 of its 69,888 processor cycles to spare. The game also doesn't use the Spectrum's ROM, so it starts instantly in the arcade's quick start.
Testing it
We test every game through the real 48K and 128K ROMs, loading the tape just as a Spectrum would, and with a computer player that plays the game for us. The player for a pinball table watches the ball, works out where it will be a frame or two ahead, and swings the right oar when the ball is about to come down onto it. It was good enough to dig up treasure and win the Kraken's hoard, which proved the full loop works. The tests then check the scoring, the game over, the high score, the attract demo and that no frame runs slow.
The computer player found real problems:
- The ball could get trapped in a pocket between a slingshot and the side wall. We moved the slingshots against the walls so the pocket no longer exists, and a ball that sits still for four seconds now gets a shove, with the message "SEA STIRS".
- Every game played out the same, because the physics had no randomness and the player always launched at full strength. The kegs now add a little spin, which makes every game different for people as well.
- An oar rising under the ball near its tip only bounced it instead of hitting it. A fix to how the game decides which side of the oar the ball is on sorted it.
- On the 128K, the game-over tune stopped the keys working for four seconds. It now plays while the game waits for you.
Before release the tape went out for private testing, and one thing came back straight away: the message when you lose a ball read "LOST AT SE", because the panel line is only ten letters wide. It now runs over two lines, and we checked every other message for the same problem.
How to play
Hold Space, fire or down to pull back the plunger, and let go to launch. The longer you hold, the harder the shot. O and P, the cursor keys or the stick swing the left and right oars, and Space swings both. Q nudges the table, once a second. On a phone, use the on-screen pad.
| What | Points |
|---|---|
| Slingshot | 10 |
| Powder keg | 100 |
| Tentacle | 150 |
| Drop target | 250 |
| Treasure | 500 |
| All three targets | 1,000 |
| Kraken bite | 1,000 |
| The hoard | 5,000 and an extra ball |
You start with three balls and earn one for each sea you clear, up to five. Clear Blighty and you go round it again for a big bonus. Your best score is kept on the title screen, and the cabinet keeps an online top ten. A few tips:
- Go for M, A and P early. The map saves a lot of wandering.
- Hold an oar up to catch the ball, then let it roll down before you swing, to aim.
- Keep the nudge for a ball heading for the gap between the oars.
- When the mouth opens, aim straight up the middle of the table.
Play it now
A Bit of Blighty is in the arcade now. Open it straight in Specz at spectrumarcade.com/arcade/play.html#blighty, or read the full guide on its game page. Thank you to Moshed for the idea. If you'd like us to make a game of your own, tell us about it on the Request a Game page. To see how our other games were made, read the stories behind Wormwood and Millrace.