1984 · Mastertronic

Squirm

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/c64/squirm with me to Gold.

The three mazes, drawn by the game's own code from the listing, with where the player, the worms, and the treasure start, and the cycle of twelve levels that puts each maze with each stage.

01 · The mazes

Three mazes, one after another

Level 1 uses maze 1, level 2 maze 2, level 3 maze 3, and the fourth level starts the round again.

Drawn by the game's own code, taken from the listing and run on a model of the C64's processor, the 6502. show_maze1, show_maze2, or show_maze3 ($246A, $2491, $24B8) copies the maze's 840 character codes to rows 2 to 22, and colour_maze ($35E8) colours it. The marks are the start cells that reset_worms ($3669) and level_complete ($394A) set: P the player, A to E the worms, T the treasure. The arrows are the open cells at the edges. Numbers written with a $ are hexadecimal, counting in sixteens; those in dark boxes are addresses in the C64's memory, and each opens the Source code tab there.

Each maze is stored as the character codes of rows 2 to 22, one byte a cell and 840 bytes in all, at maze1 ($16D2), maze2 ($1A1A), and maze3 ($1D62). Walls are characters $1B to $25, and the corridors are spaces. The status lines above and below are drawn from stored patterns of their own. Every maze starts the player on row 12 at the left edge, and each worm on the same cell in all three mazes, so those cells are corridor in all three.

The open cells at the edges are the exits. A step left from the first column lands in the last column of the row above, because the position is kept as an address in screen memory, where each row follows straight on from the one before. In mazes 1 and 3 the player can leave by row 12 at the left and comes in on row 11 at the right. Maze 2 has two openings on each side, and so two ways across.

02 · The cycle

Every maze with every stage, once in twelve levels

The maze goes round in threes and the stage of what moves in fours, so the same pairing comes back every twelve levels. The game is a jiffy (a sixtieth of a second) a pass faster each time round the stages.

Worked out by the game's own level_complete ($3879) and one pass of the main loop for each level, run on the model of the 6502, with the bonus run left out. A pass is one time round the main loop, the routine that moves everything one step. The table shows maze_number ($2682), level_stage ($2688), and step_delay ($2689) as each level begins.

The stage decides what moves (move_creatures, $3A46). Worms C, D, and E move at every stage. The treasure joins at stage 2, worm B at stage 3, and worm A, the long one, only at stage 4. A level's speed comes from how many cycles of four stages have gone by (How it works).