Sabreman fights with a bolt he throws, and it can harm only one kind of thing: what falls from the sky. Everything that lives in a room -- spiders, heads, spikes, the still hazards that line the paths -- is beyond it, to be walked round or jumped. This page is the bolt, the things from the sky, the score, and what makes a thing deadly. Knight Lore has none of it but the puff, its sparkle.

The bolt

FIRE runs in the player's turn. A fire key newly pressed (FIRE_HELD makes it one bolt a press) takes the first free of the two bolt records, copies the legs' record into it and makes it graphic 150, moving eight units a turn the way he faces (BOLT_STEPS, by GET_SPRITE_DIR), starting two steps -- 16 units -- ahead of him and 4 higher, with flags $14 and a half-height of 8. A start outside the room's walls (he is in a doorway, or facing a wall close up) is taken back. Then BOLT flies it: the fall and the cut (DEC_DZ_AND_UPDATE_UVZ) as for anything, but never below Z 132, so it flies level; its graphic cycles 151, 150, 149; it tests the two things from the sky (BOLT_HIT) and shoots one down if it touches it; and if its move was cut short in U or V by anything else it becomes a puff (START_PUFF), graphics 64 to 71 a turn each (PUFF, END_PUFF; the animations page plays it), and then nothing.

FacingWayStep in UStep in VStarts at U +Starts at V +
0-U-80-160
1+U80160
2+V08016
3-V0-80-16

Fired in room 30, which is empty, facing -U from the middle, in a simulator when this page was built:

TurnGraphicUVZ
0149the bolt112128132
1151the bolt104128132
2150the bolt96128132
3149the bolt88128132
4151the bolt80128132
5150the bolt72128132
664the puff70128132stopped in U (+$0C bit 0)
765the puff70128132stopped in U (+$0C bit 0)
866the puff70128132stopped in U (+$0C bit 0)
967the puff70128132stopped in U (+$0C bit 0)
1068the puff70128132stopped in U (+$0C bit 0)
1169the puff70128132stopped in U (+$0C bit 0)
1270the puff70128132stopped in U (+$0C bit 0)
1371the puff70128132stopped in U (+$0C bit 0)
A bolt fired at the wall

The bolt, and its puff against the wall.

What a bolt can hit

BOLT_HIT tests only records 4 and 5, the things from the sky, and skips graphics below 8 and the puff: each axis, the distance between them no more than their half-sizes added, plus 2. Nothing else is a target. Anything else in the way is only an obstacle to the collision code, which cuts the bolt's move short and so makes it a puff -- the heads, the spiders and the still hazards carry on as if nothing happened. In room 6, from a place out of their way, a bolt thrown at one of the two pacing heads:

TurnThe boltThe head (graphic, U, V)
093, 136, 112
1graphic 149 at U 15493, 136, 114
2graphic 64 at U 149, stopped93, 136, 116
3graphic 65 at U 149, stopped93, 136, 118
4graphic 66 at U 149, stopped93, 136, 120
5graphic 67 at U 149, stopped93, 136, 122
6graphic 68 at U 149, stopped93, 136, 124
7graphic 69 at U 149, stopped93, 136, 126
8graphic 70 at U 149, stopped93, 136, 128
9graphic 71 at U 149, stopped93, 136, 130
A bolt against a pacing head

A bolt against a pacing head: the bolt puffs, the head paces on.

The bolts' test has one more use: the well counts the turns a bolt touches it (BOLT_TOUCHING, and see the quest).

WhatAgainstWhat happensWhere
A bolta thing from the skyshot down: points, and it becomes a puff; the bolt vanishesSHOOT_DOWN
A boltthe wella turn of contact counted; 32 in one visit give the bucketWELL
A boltanything else, or a wallits move is cut short, and it becomes a puffBOLT
Anything deadly (+$0D bit 7)what it moves intokilled (+$0D bit 6)ADJ_DU_FOR_OBJ_INTERSECT
Anything deadly (+$0D bit 5)what moves into itkilledADJ_DU_FOR_OBJ_INTERSECT
A thing from the sky that homesthe playernothing: it is not deadlyHOMER

Things from the sky

Every turn SKY_DROP counts DROP_TIMER down (it is reset at each room's start and after each drop, by RESET_DROP_TIMER -- 80 turns, or 8 once the first quest item is done: see the quest page). When it has run out, there is a chance of one in four each turn, two bits of the random number, of a drop: a free one of the two records at FLYERS gets a copy of FLYER_TEMPLATE -- Z 216, half-sizes 8, 8 and 8, flags $10 -- a U and a V of 104 plus a random number masked with $2F (104 to 119 or 136 to 151: never on the room's middle lines), and one of the eight graphics at DROP_GRAPHICS picked by three more bits of the random number. If it would overlap anything it is taken back. Nothing falls at all in a room with the well, a quest item or a piece of the pentagram (BAN_DROPS; 7 rooms as the game starts, and room 82 once the pentagram is showing).

SlotGraphicSpriteUpdate routineDeadlyPoints, by frame
0164Graphic 164HOMERno512, 516
1160Graphic 160HOMERno502, 506
248Graphic 48HOMERno140, 144
380Graphic 80SKY_ROAMERyes241, 245
4168Graphic 168SKY_WALKERyes522, 526
5160Graphic 160HOMERno502, 506
648Graphic 48HOMERno140, 144
780Graphic 80SKY_ROAMERyes241, 245

HOMER, the homer, flies at him: a speed in each of U, V and Z kept in sixteenths, each pulled 3 a turn towards his legs' U and V and his body's Z, up to 56 or down to -72, and a step each turn of the speed plus 8 over 16 -- at most 4 units either way; bumping into anything in U or V turns that speed round, so it bounces. It is never deadly: no update routine of a homer sets a kill bit, and its record starts with a clear +$0D. ROAMER (graphics 80 and 81, at SKY_ROAMER) and SKY_WALKER (168 to 171) are the ones that kill: they fall, then run straight at 4 a turn, turning at a bump, deadly both ways.

That chance is less of one than it looks. OBJECT_DONE stirs the random number once per object, with R and the turn counter, and with interrupts off nothing else touches R: a turn in which nothing changes runs exactly the instructions the turn before did. In room 30, empty, with the timer run out and the player standing still, the random number was read at the test for 150 turns: it moved by an even amount every turn, so its lowest bit never changed; it was odd, the test wants both low bits clear, and nothing fell. That was in the simulator; the same should hold on a Spectrum, whose R counts instructions the same way, but that is inferred. Anything that changes the turn's path -- turning, walking, firing -- stirs it again.

In room 30 again, with the drop timer run out by writing it, the player turning a quarter every six turns and, once something had fallen, firing between turns: a homer, graphic 165, fell 85 turns in, from Z 215 at (108, 145). It homed on him and hung round him for 39 turns without harming him, until a bolt hit it, at graphic 167, for 516 points:

Turns after the dropGraphicUVZSpeeds U, V, ZScore
01651081452153, -3, -30
616711214120521, -21, -210
1216512313118939, -39, -390
1816713811816633, -27, -570
2416514811113615, -9, -690
30167151110128-3, 9, -510
36165147117128-21, 27, -330
38167145121128-27, 33, -270
3965145121128-27, 33, -27516
A thing from the sky, homing, and shot down

The thing from the sky: falling, homing, and shot down.

The score

SHOOT_DOWN makes the points out of the graphic number of what was hit, bits into BCD digits: the hundreds from bits 5 to 7, the tens from bits 2 to 4, the units from bits 6, 7 and 0. No digit can pass 7, so the result is always good BCD without a check. ADD_SCORE adds them and SHOW_SCORE copies the score straight to the screen. Things animate by changing their graphic, so the points depend on the frame the bolt catches. Run on its own for every graphic a thing from the sky can have:

WhatGraphicsPoints
homers48-51, 160-16748: 140, 49: 144, 50: 140, 51: 144, 160: 502, 161: 506, 162: 502, 163: 506, 164: 512, 165: 516, 166: 512, 167: 516
the creature that roams80-8180: 241, 81: 245
the walker168-171168: 522, 169: 526, 170: 522, 171: 526

What makes a thing deadly

Two bits of +$0D: bit 7, kills what it moves into, and bit 5, kills what touches it. MAKE_DEADLY sets both, and the collision code (ADJ_DU_FOR_OBJ_INTERSECT and the other two axes) passes the kill -- bit 6 -- to whichever party the other's bits say. These are all the routines that call it, found by searching the code for the call, with the graphics the update table gives them and the rooms that place those:

RoutineGraphicsWhere
STILL_DEADLY23, 30, 74-7573 rooms, from 0, 1, 2, 4, 5, 7, 12, 13, 15, 16, 18, 20 ...
DEADLY_AND_DRAWnone (unreached)
SPIKES28rooms 8, 14, 19, 41, 76, 103, 111
DEADLY_BOBBER86rooms 11, 27, 42, 55, 62, 88, 107, 108
DEADLY_PACER_U92rooms 29, 34, 47, 83, 99, 120, 130
DEADLY_PACER_V93rooms 6, 29, 49, 129, 147
SPIDER8916 rooms, from 3, 9, 13, 14, 15, 24, 26, 53, 69, 98, 106, 109 ...
ROAMER16-17, 80-81rooms 20, 52, 76, 96, 106, 117, 125, 131; and from the sky
SKY_WALKER168-171no room; and from the sky

A killed player's legs become the puff and his body with them; when the puff is over, both records are empty and the main loop starts a life (see rooms and doorways for where).

Confirmed and inferred