1984 · First Star Software

Boulder Dash

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

Every cave is a recipe: random dirt from a seed, then walls drawn from a short list of records.

01 · Every cave

Twenty caves, five levels each

Choose a cave and a level to see its map as the game builds it. Sixteen caves are the playing caves A to P, and four are the short bonus caves that follow D, H, L and P.

    Each map is built by the page from the cave's own bytes ($582E) with the game's own recipe, then drawn with the game's character shapes. Every object is named beside its picture, because the colours alone do not tell them apart. Animated objects are shown in their first frame.

    02 · How a map is made

    Random dirt first, then drawn walls

    A cave is not stored as a picture. The game fills rows 1 to 21 of the 40 by 22 cave with random objects, then draws the cave's fixed features, the steel border first, on top. The fill takes each cell's random byte from a small sixteen-bit generator ($7085) and compares it with four thresholds in the cave's header: below the first threshold the cell becomes the first of four header codes, below the second the second code, and so on, with the last threshold that matches winning. A cell that matches none is dirt ($8029).

    The generator starts from one of five seed bytes in the header, one for each level. The cave is therefore the same every time that cave and level are played, and levels differ in where the boulders and diamonds fall, not in the walls ($8226). The random-byte routine at $6E68 is a different one, driven by the timers. It serves the amoeba, Rockford's push and idle animation, the cave's opening and closing, the glisten, and the sound; the fireflies and butterflies make no random choices.

    The fixed features are a list of records from $2420 in the cave header copy: a single object, a line, a filled rectangle with a different inner object, or an outline rectangle. The top two bits of the first byte choose which, and the low six bits are the object ($8518). The list ends with $FF. The steel border is drawn first ($85A7), so a record can overwrite it.