Developer Diary: Designing Waves of Space Jellies in Jelly Storm
A swaying formation of 24 jellies, red divers that swoop at you and a march that quickens every wave. How Jelly Storm came together on the Spectrum.
Jelly Storm is our fixed-screen shoot-'em-up for the 48K and 128K Spectrum. You guard a moon base from waves of space jellyfish, moving a gun base along the bottom of the screen while the jellies sway overhead and drop stings. This diary covers how the formation moves, why some jellies break away, how the waves get harder and how the music keeps pace.
A formation that speeds itself up
Each wave starts with 24 jellies in four rows of six. The whole block sways from side to side, and every time it reaches an edge it drops down a row. The threat is easy to read: the lower they get, the less time you have.
The formation also speeds up as you shoot jellies. A full block plods along; the last few dart about. So the end of every wave is the tense part, even though there are fewer targets left. If the jellies reach the ground, the game is over, however many lives you still have.
Divers that break formation
A formation that only sways can be beaten by standing still and firing straight up. To stop that, a jelly sometimes breaks away as a red diver and steers towards you. You can shoot it on the way down or step out of its path.
Divers are worth 150 points, against 10 to 40 for an ordinary jelly (10 on the bottom row, rising by 10 a row to 40 at the top). The big reward makes it tempting to stand your ground and take the shot rather than simply dodging. Because divers turn red, you get a moment's warning before one comes for you.
Nine waves of trouble
Clear a wave and the next one is harder in several small ways at once, rather than one big jump:
- The formation starts on a lower row.
- It steps faster.
- More stings can be falling at the same time, from two at first up to six.
- From wave four the stings themselves fall faster.
- Divers come more often and move more quickly.
The difficulty stops rising at wave nine. By then the jellies start close to the ground, so there is little room for mistakes. All of these settings live in one routine that sets up each new wave, which made them easy to tune: the step delay, the number and speed of stings, and how often divers appear and how fast they fly. You have three lives, and your high score is kept between games until you switch off.
Drawing it all on a Spectrum
Jelly Storm is written in Z80 assembly and the code is only about 4.9 KB. The formation is drawn straight into the screen's character cells, and each row of jellies gets its colour from that row's attributes, the colour settings for each 8 by 8 cell. Our article on why Spectrum colours clash explains how those cells work.
Everything that moves freely (your gun, the shots, the stings, the diver and the explosions) is an XOR sprite. Drawing an XOR sprite a second time in the same place rubs it out, so each frame the game erases these, updates them and draws them again. Hits are worked out from positions in the game's own records rather than by checking pixels on the screen.
The game makes no calls to the Sinclair ROM at all. It has its own font and its own interrupt routine, which means it runs in Specz's quick-start mode, the one that doesn't need the ROM.
A march that gets faster
On a 48K the beeper does all the work: a chirp for each shot, short noise pops when jellies burst, a two-tone marching beat, a rumble when you lose a life and a jingle between waves. The title tune plays in short pieces, so a quick tap of a key always starts the game straight away.
On a 128K the AY sound chip takes over the music. The title plays "Moon Base Alpha-Bet", a bouncy disco tune, and the game plays "Jelly March" over a pumping bass. The march follows the wave number: it rises in key and quickens with each wave, until wave nine runs at twice the speed of wave one. Our history of the Spectrum 128 and its AY chip explains what that chip added. On a 48K the game is unchanged and never touches the AY.
Testing and playing
We loaded the tape through the real 48K start-up routine and the 128K Tape Loader, and an autopilot played on to waves three to five on both machines, using keys on one and a Kempston joystick on the other. In Specz in a browser at phone size it ran at 50 frames a second, with the touch FIRE button starting the game.
The controls cover O and P, 5 and 8, or 6 and 7 to move, with Space, M or 0 to fire, so most old keyboard habits work. A Kempston joystick is found automatically, and our guide to Spectrum joysticks explains the different layouts. You can play Jelly Storm in your browser now, read the Mothfall developer diary for another of our shooters, or find your next game in the arcade.