1987 · Electric Dreams Software

Fire Trap

This minisite was contributed by 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/fire-trap with me to Gold.

Sprites for the firefighter, the flames, and the creatures are 128 shapes of 24 by 21 pixels, shared between raster lines so that more than eight can be on screen at once.

The screen

Two building screens and a text screen

The picture is built in the video chip's second bank ($4000-$7FFF). The building is drawn into one of two screens at $5000 and $5800, and the game swaps them every tick (draw_screen, $2ECC). The score, stage, and lives line at the bottom comes from a third text screen at $5C00 with the font at $4800, which a raster handler at line 212 switches in (raster_status, $2C5B). The same text screen builds the title, high-score, and name-entry displays.

The two shared background colours are fixed for a stage: $D022 is set to grey and $D023 to the stage's building colour from the Maps tab (raster_top, $2ABA).

The sprites

One hundred twenty-eight shapes

Blocks $80-$FF at $6000-$7FFF hold the firefighter's poses, flames, creatures, pickups, window frames, and the FINISH sign.

Every shape from the game's bytes, 24 by 21 pixels in two-bit colour. The game gives each sprite its own colour and shares two more, so the colours here are a stand-in: pairs of bits 01, 10, and 11 are drawn in pink, white, and yellow, and the button below switches to four greys.

The hardware can show only eight sprites. Fire Trap keeps a list of sprite records at $0900 (x, y, colour, and shape for each, counted in $4D), sorts it by y (sort_sprites, $326F), and deals the records into five band tables, three for sprites 4 to 7 and two for sprites 0 to 3, which draw_screen copies to $0F00. The raster handlers at lines 20, 92, 124, and 155 move the eight hardware sprites to the next band's records, so a sprite on the first band's lines is used again for a later band's.

The building

Characters 16 to a cell

Each cell of a map is a block of sixteen characters, so the whole building is drawn with characters and no bitmap. cycle_palette ($CF13) cycles four colours through two of the tile definitions every tick, so those cells change colour without the map changing. The window tiles are drawn from the character set at $4000, which set_tile_source ($CE3A) refills at the start of each stage from one of two sets (a third is used for the full-screen scenes), so stages with a different tile set look different even on the same map.