Everything that flies -- attackers, clouds, bullets, pick-ups, debris -- is one of nine 24-byte records at object_records, each with a type byte that picks an update routine and a list of frames. Once a pass the nine are rubbed out, updated, redrawn, and tested against the ship and the player's shots. What touching one does is a byte of effect bits.

The record

The same layout serves the nine sky records, the ship's record, the four shot records (shot_records), the rocket's drawing record (rocket_record) and the first 24 bytes of the six ground-object records (ground_objects), so one set of routines moves, places and draws them all.

OffsetField
+0type: $FF free, $13-$1E for the sky objects
+1 +2 +3x: map column, pixel in the page, fraction
+4 +5 +6y: map row, pixel (the bottom line), fraction; y grows downwards
+7 +8speed across, signed 8.8 pixels a pass, high byte first
+9 +Aspeed down, the same
+B +Cacceleration across
+Dtwo colours: ink and BRIGHT for odd passes in bits 0-3, for even passes in bits 4-7
+E +Facceleration down
+10flags: bits 0-2 top speed less one; 3 skip a placing; 4 free next pass; 5 shot; 6 straddles the left edge; 7 drawn
+11 +12where it was drawn: screen x, bottom line
+13frame: bits 0-3 the frame, 4-5 a count, 6-7 the count's reload
+14frame range: first frame in the high nibble, last in the low
+15 +16the type's own: a timer, a path step, a hit count, a target
+17contact cool-down or a missile's target in the high nibble; bit 3 exploding; bits 0-2 the explosion's step

Records 0-3 are for attackers, 4-6 for what attackers and ground objects throw, 7-8 for clouds; all nine become the ship's wreck when it dies.

The types and their update routines

object_handlers has a word for each type from $13, and object_graphic_lists a word for each graphic number pointing at its frames; run_sky_object_handler jumps to the type's routine. Read from the game:

TypeUpdate routineFramesWhat (by appearance and behaviour)
$13update_cloudcloud_framescloud
$14update_attackertype14_graphicsattacker
$15update_debrisattacker_framesdebris
$16update_attacker$98A0attacker
$17update_attacker$98A8attacker
$18update_attacker$98ACattacker
$19update_tough_attacker$98B4the tough attacker
$1Aupdate_attacker$98B8attacker
$1Btype1b_graphicstype1b_graphics(ground objects only)
$1Cupdate_small_objectsmall_thing_framessmall things: bullets, pick-ups, wreck pieces
$1Dupdate_rammerrammer_framesrocks and comets of a meteor shower
$1Eupdate_rocket_partrocket_part_framesa rocket part falling into place

Type $1B's word points at a graphic list (type1b_graphics), not code. It does no harm: type $1B is used only by ground objects, which never go through the table.

The update routines end in the shared tail of update_attacker: check_shot (shot? then score it and become debris), change_course (the type's steering now and then), accelerate (speed += acceleration, held to the top speed by limit_speed), animate_object (the animation: a count in bits 4-5 of +$13 steps the frame through the range in +$14), move_bouncing or move_or_explode (the landscape test, then move_object), place_object (placed on the screen, steered back to the view by steer_to_view), and the drawing (draw_object_images, colour_sprite; see drawing). Steering never sets a speed, only an acceleration, so every attacker swings smoothly and the clamp keeps it from running away.

The contact effect

Each update routine leaves a byte in contact_effect. ship_contact tests the object's drawn box against the ship's fixed box -- 40 pixels wide from x 100, 16 lines high -- with boxes_overlap, and on a touch acts on the bits from bit 7 down:

BitRoutineEffect
7contact_slow_shipslow the ship: halve each of its speeds that agrees in sign with the object's
6contact_damagedamage, at most once every 16 passes per object
5contact_refuelrefuel: 28 of the gauge's 124 steps
4contact_pushpush: the object's speed halved and reversed, the same added to the ship's
3contact_collectcollect: the object freed next pass, with a sound
2contact_drain_fueldrain fuel: 16 steps
1contact_extra_lifean extra life, at most 9
0contact_destroydestroy: the object counts as shot

Every attacker leaves $50 (damage and push), a cloud $80, the rocks $51, debris 0, a falling rocket part $10. Type $1C's effect goes by its frame, from small_object_effects, read from the game:

FrameWhatEffectBits
0bullet$50damage, push
1bullet$50damage, push
2bullet$50damage, push
3the refuel pick-up$28refuel, collect
4pellet$58damage, push, collect
5pellet$58damage, push, collect
6the fuel thief$1Cpush, collect, drain fuel
7pellet$58damage, push, collect
8the ship icon (an extra life)$1Apush, collect, extra life
9the shield ring$FFthe shield
10the attackers' dash$58damage, push, collect

$FF is the shield: ship_contact starts the shield timer and frees the ring.

Spawning, and the load

object_load is recounted every pass: one for each record in use, one more for each drawn last pass, one more for a big cloud, plus half the rocket parts while the rocket is drawn. update_objects spawns below 4 -- half the time a cloud (spawn_cloud), otherwise an attacker (spawn_attacker) -- spawn_tick not at 8 or more, and find_free_record gives up at 7: a cheap stand-in for how busy the pass is, things on the screen weighing double because drawing is what costs. Attackers start out of sight at fixed points (spawn_points, allowed by the kind of cell, spawn_point_masks) and come in the order of wave_table.

Worked example: the ship left sitting on the plain at the start of a game (undamaged and refuelled between passes) for 600 passes, the nine records read after each. The load averaged 7.7 and reached 11. The records that started, by type:

TypeWhatStartedIn records
$13cloud100, 2, 7, 8
$17attacker11
$18attacker10
$1Aattacker12
$1Drocks and comets of a meteor shower80, 2, 3

The first pass after the hundredth with four or more things drawn: each record's drawn picture outlined in its colour, and the records as the game held them:

The sky objects' records

The sky objects over the plain.

RecordTypex (column, pixel)y (row, pixel)Speed (across, down)Frame byte
0$13$0D $95$07 $7F-2.00, -1.00$00drawn
1$17$0E $28$07 $8F+0.00, +0.00$F1drawn
2free
3free
4free
5free
6free
7$13$0D $97$07 $7F-2.00, -1.00$01drawn
8$13$0D $A3$07 $80-2.00, -1.00$00drawn

The path of the attacker in record 1 over the 568 passes it was drawn, the middle of its picture each pass, over the same screen: in from the edge of the view and down onto the ship, where it stays, pushing it about (the damage was undone between passes, so the ship lived on). The screen positions include the small scrolls those pushes caused.

An attacker's path

Record 1's path.

Confirmed and inferred