1987 · Thalamus

Delta

This minisite was contributed by chunkypixel, 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/delta with me to Gold.

An inverted character set, bullets cut out of glyphs, hits found by reading the screen, and a shop that is an attack wave (Waves).

01 · Colour from nothing

An inverted character set

Every set bit in Delta's font is drawn black. The colours come from the bits that are clear.

Left: the three star glyphs, $2F, $30 and $31, as the frame is drawn: each is solid but for one clear pixel. Right: the 18 star positions at $100A-$101B, each drawn in all four quarters of the screen, run by a port of stars_update ($1DB9). Colours are the three backgrounds of the recorded frame.

The screen runs in the VIC-II's extended background colour mode ($D011 = $5C). In that mode only 64 glyphs exist, and the top two bits of each character code pick one of four background colours, $D021 to $D024, instead of choosing a glyph. Colour RAM is black everywhere (clear_screen, $0DDD). A set bit is therefore black, and a clear bit shows the background colour the code selects. The blank character $2E is solid, so empty space is black.

A star is one character with a single clear bit. Three layers use the same trick with three codes: $6F, $30 and $B1 point at glyphs $2F, $30 and $31 through three different backgrounds, so each layer has its own colour. To move a layer, the game rotates the one row of its glyph that holds the clear bit (ROL at $1D1C). Every star of that layer slides one pixel left at once. When the bit falls out, it goes back in at the right edge and the six stars of the layer move one column left. The fast layer rotates twice a frame, the middle once, the slow one every second frame. The four background colours step through a six-entry cycle every fourth frame (colour_cycle_step, $1DDD), so the stars change colour as they drift.

02 · Bullets made of type

Every shot is a character

The enemies' shots are cut out of whatever glyph lies under them, and hits are found by reading the screen.

Position in the cell
Underneath

A port of draw_enemy_shot_0 ($25D5): the two glyphs under the shot are ANDed with two columns of the mask table shot_masks at $FF70. Clear bits are drawn in one colour here; on the screen they take the background colour of the shot's character code.

Enemy shots, homing bombs and eight-way bullets are all drawn with characters. An aimed shot is a four-pixel ball that moves one pixel at a time across two cells. The game does not draw the ball. It builds two new glyphs each frame, taking the glyphs under the shot and clearing the ball's bits out of them with one of eight masks. In an inverted font a clear bit is colour, so the ball appears, and a star under it stays visible. The bombs read the same table through patched operands ($28C1, $299C).

Hits by reading the screen

The VIC-II can report when a sprite touches a character ($D01F). Delta never reads that register. Instead:

Sprite against sprite (the ship and the enemies, the rows of rocks, the shop's icons) uses the chip's own collision register $D01E, read in three of the bands.

03 · The corner shop in space

The shop

Some attack waves are made of weapon icons. Fly into a blue one to buy it. Grey ones kill.

Credits
Click an icon to fly into it.

A port of shop_try_buy ($2261).

The shop is not a separate screen. It is an attack group like the others (bit 4 of the wave record's byte 2 marks it), whose sprites are the seven weapon icons, flying through the play area. In stage 1 it is the second group to arrive, about three seconds in. An icon costs its own number in credits. Icons the player can afford are light blue and the rest grey (icons_update, $0808).

Touching an icon that costs more than the credits counts as being shot, and so does touching a second icon in the same shop: one purchase per visit. Buying spends every credit. The price goes, and each credit left over is paid out as 100 points. The bought icon then blinks 14 times along the bottom row, eight frames each, and only then takes effect.

A credit comes from clearing a whole attack group: when a group ends and none of its enemies escaped, most groups add one ($80B5).

The seven weapons, as the game draws them. At the top of each card, the icon as it flies in the shop: light blue when the player can afford it and grey when not (icons_update, $0808), in stage 1's multicolours. Each shop sprite always shows the same frame, the same in every shop of the 31 recorded stages. Below, the icon's square in the row along the bottom of the screen at each level, from the frame tables at $0F07-$0F19 that icons_update reads with the weapon's level, in the row's own multicolours ($105E, $105F). A weapon not owned shows the empty square $8D. The shield's square counts the hits it has left. The eighth square in the row, icon 0, shows the credits: $8D plus the count, the digits 1-7 at $8E-$94.

Weapons change the enemies too. Owning the shield brings out the homing bombs, and the double laser and slow-down change how finely they aim (enemy_fire_setup, $9100; enemy fire). Every weapon is lost when the ship dies ($397E).

04 · The enemies

An enemy's toughness comes from its wave, not its shape

Across the 32 stages the attack waves use 22 different enemies. Most are one sprite. Three are big ones built from seven sprites that fly together.

Each enemy once, whatever stage it flies in. A single-sprite enemy is told apart by its animation list: the wave record's byte 1 plus its first path segment's offset, an index into the lists at $1300. It is drawn with that list's frames, one every 4 frames as enemy_anim_step ($3C89) steps it. A big enemy is drawn as its parts stood on the first frame they were all on screen. Everything else is counted from the wave recordings of 31 stages, shop icons left out (stage 29 is not recorded, but its wave list holds no enemy that is not here): the stages each enemy flies in, how many came, the hit points and points each started with (points as the panel shows them, ten times what the game adds, $11D8), the colours it was given ($A800), and whether its path ever let it fire. The shapes are the ones the video chip showed in the recordings, since the game rewrites $4000-$40FF in play. The two shared multicolours change by stage; each card uses the first stage it appears in. Some enemies turn into a new form when shot instead of dying (bit 7 of a path segment's byte 3); those forms come from the list read through $12FE and are not drawn here.

The hit points come from the wave, not the enemy: wave_hits_table ($A100) is indexed by the record and the enemy's place in its group, so one shape can die at the first hit in one stage and take 32 hits, or none, in another. The points work the same way, through the record's byte 3, and so does the colour. 0 or 1 hit points dies at the first hit; $FF cannot be destroyed.

Every shape the enemies, the ship and the hazards are drawn with is on the Graphics tab.

The commonest is enemy 10, a single frame ($60) that came 650 times in 10 stages, from one hit to seven or indestructible. Enemy 4 shows the spread at its widest: the same shape takes anything from 1 to 32 hits, or cannot be destroyed at all.

05 · Enemy fire

Three kinds of fire, paid for from one budget

Enemies fire three ways, all drawn with characters (enemy_fire_decide, $9208): aimed shots that travel along a row, six at most; homing bombs two characters square, two at most; and bullets, the character $ED moving in one of eight directions, seven at most.

Each frame one enemy, taking the seven in turn, may fire. It must be alive, past its entrance and allowed to fire by its wave, and its own counter must have reached the stage's fire rate. New fire is allowed only while the fire already in flight costs less than the stage's budget: a shot counts 5, a bomb 10 and a bullet 1 (every stage's numbers).

Which kind comes depends on the player's weapons (enemy_fire_setup, $9100). Owning the shield brings the homing bombs, and owning the double laser or the slow-down changes how finely the shots are aimed. Buying weapons makes the enemies fire differently.