![]() |
Templates: what a room can place |
The 37 kinds of thing a room record can place: the templates the builder (BUILD_ROOM) makes object records from, after the backgrounds and the $FF that ends them. A room gives a group header -- bits 3-7 a template number, an index into OBJECT_TABLE, and bits 0-2 how many copies less one -- then a position byte for each copy: U = 72 + 16 times bits 0-2, V = 72 + 16 times bits 3-5, and Z the floor plus 12 times bits 6-7, so a room is an 8 by 8 grid of cells, four levels high. The count at +1 of the record, not the data, ends the build: a group can be cut short by it.
A template is a list of five-byte parts ended by a zero: the graphic, the half-sizes in U and V, the height (Z is an object's base, not its middle) and the flags, which go to +0 and +4 to +7 of a record, the position to +1 to +3 and the room to +8. Most have one part; 7 have two at the same place: the creatures that walk on a separate lower half, and the chambers' sockets with the sparkle over them. The graphic decides everything else, its update routine and its sprite (see every graphic).
A header can name 32 templates, and the game has more. The table at OBJECT_TABLE is 40 words: header number 31 is not a template but moves the builder's TEMPLATES_AT on 64 bytes, to the words from number 32 on, for the rest of the room, and the byte after it is skipped. So templates 33 to 39 are header numbers 1 to 7 after a 31; they are listed here by their place in the table. Words 0, 31 and 32 are zero: a header number of 0 is the placement nudge, below, on either page, so neither page's word 0 is ever read, and 31 is the switch. The rooms switch pages 12 times; the second page holds the remote-control buttons and pad, the things that break and the leapers.
Header number 0 is not a template either: the byte after it becomes PLACE_NUDGE for the groups that follow (BUILD_ROOM): its bit 0 adds 8 to U, bit 1 adds 8 to V, and the rest of it is added to Z. The rooms set it 42 times, always to $00 or $30: 41 times $30, which lifts what follows by 48, four levels, so that a room can stack things eight levels high; the bits that move a thing half a cell are never used. Pentagram's builder has the same code with no jump to it (see Pentagram's templates); here it is live. The picture is the game's: a one-off room with four of template 1 at levels 0 to 3 of one cell, the nudge of $30, and the same four again, which land on top of the first.
Each is drawn here by the game, on its own near the middle of an empty room (cell 3, 3, on the floor), from a one-off room record the game builds and draws its first turn of, in SkoolKit's simulator; a thing that moves has had one turn, and one that the rooms always raise with the nudge is drawn on the floor all the same. Knight Lore's templates are the same idea with a sixth byte, an offset (see Knight Lore's templates).
1: A plain block -- OBJECT1
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 30 | 8, 8; 12 | $10 (to be drawn) | DRAW_AT_L16_D9 |
812 copies in 91 rooms, 36 of them raised by the nudge: $02, $04, $05, $0A, $0C, $0D, $12, $14, $1C, $1D, $20, $23, $27, $28, $2F, $30, $31, $33, $34, $36, $37, $38, $39, $3B, $3F, $40, $41, $42, $43, $44, $45, $46, $48, $49, $4A, $4B, $4C, $4E, $4F, $54, $56, $57, $58, $59, $61, $62, $64, $65, $67, $6A, $6B, $6E, $74, $75, $77, $78, $7A, $7B, $82, $84, $86, $87, $8C, $8D, $93, $94, $95, $96, $98, $99, $9A, $9C, $A4, $A5, $A6, $A7, $AA, $AB, $B5, $B7, $B9, $BA, $C6, $C7, $C8, $C9, $D6, $D8, $E7, $F7, $F8.
2: A block with a raised round top that can be pushed -- OBJECT2
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 28 | 7, 7; 12 | $14 (pushable, to be drawn) | PUSHABLE |
32 copies in 19 rooms, 5 of them raised by the nudge: $0A, $1C, $28, $41, $44, $49, $4B, $61, $62, $6B, $7A, $8C, $96, $99, $9C, $AA, $B6, $BA, $C8.
3: A block tapering to the bottom that can be pushed -- OBJECT3
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 29 | 7, 7; 12 | $14 (pushable, to be drawn) | PUSHABLE_INVERTED |
20 copies in 13 rooms, 4 of them raised by the nudge: $0A, $1C, $37, $41, $4B, $61, $62, $7A, $82, $8C, $99, $BA, $C8.
4: A plain block that bobs up and down -- OBJECT4
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 31 | 8, 8; 12 | $14 (pushable, to be drawn) | BOBBER, in LIFT |
15 copies in 9 rooms, 1 of them raised by the nudge: $1D, $36, $39, $4A, $54, $86, $B9, $C6, $E7.
5: A plain block that sinks while stood on -- OBJECT5
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 44 | 8, 8; 12 | $10 (to be drawn) | DROPPING_BLOCK |
19 copies in 9 rooms, 2 of them raised by the nudge: $12, $82, $95, $9C, $A4, $AB, $B5, $B9, $F7.
6: A plain block that collapses when landed on -- OBJECT6
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 45 | 8, 8; 12 | $10 (to be drawn) | COLLAPSING_BLOCK |
203 copies in 38 rooms, 32 of them raised by the nudge: $02, $12, $15, $1B, $20, $27, $2F, $31, $3B, $3E, $3F, $40, $43, $44, $45, $46, $48, $4C, $59, $64, $6E, $75, $7B, $82, $87, $94, $95, $9A, $9C, $A4, $A7, $AA, $B5, $B6, $B8, $C7, $F7, $F8.
7: A crown of spikes on a base, deadly -- OBJECT7
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 46 | 8, 8; 12 | $10 (to be drawn) | SPIKES |
175 copies in 36 rooms, 2 of them raised by the nudge: $03, $04, $0D, $12, $15, $1A, $1D, $20, $27, $39, $3E, $40, $4A, $4C, $4F, $54, $57, $59, $5B, $64, $75, $76, $77, $86, $87, $88, $8A, $93, $95, $9C, $A7, $B6, $B9, $C7, $C8, $E7.
8: A plain block that carries things forwards in V -- OBJECT8
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 68 | 8, 8; 12 | $10 (to be drawn) | CONVEYOR_PLUS_V |
47 copies in 8 rooms: $0D, $1A, $23, $54, $5B, $76, $C9, $F7.
9: A plain block that carries things forwards in U -- OBJECT9
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 69 | 8, 8; 12 | $10 (to be drawn) | CONVEYOR_PLUS_U |
26 copies in 8 rooms, 1 of them raised by the nudge: $0D, $3B, $40, $43, $48, $4A, $96, $F7.
10: A plain block that carries things back in V -- OBJECT10
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 70 | 8, 8; 12 | $10 (to be drawn) | CONVEYOR_MINUS_V |
11: A plain block that carries things back in U -- OBJECT11
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 71 | 8, 8; 12 | $10 (to be drawn) | CONVEYOR_MINUS_U |
12: A plain block that lifts -- OBJECT12
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 47 | 8, 8; 12 | $14 (pushable, to be drawn) | LIFT |
13: A plain block that shuttles in U -- OBJECT13
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 66 | 8, 8; 12 | $10 (to be drawn) | SHUTTLE_U |
3 copies in 2 rooms, 1 of them raised by the nudge: $3C, $61.
14: A plain block that shuttles in V -- OBJECT14
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 67 | 8, 8; 12 | $10 (to be drawn) | SHUTTLE_V |
6 copies in 4 rooms, 1 of them raised by the nudge: $30, $4F, $61, $F7.
15: A pyramid, deadly -- OBJECT15
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 72 | 8, 8; 12 | $10 (to be drawn) | STILL_DEADLY |
232 copies in 30 rooms, 7 of them raised by the nudge: $04, $14, $23, $24, $2F, $30, $33, $34, $36, $38, $3B, $43, $45, $46, $48, $54, $56, $61, $6B, $77, $78, $7D, $86, $98, $A4, $AB, $B8, $D6, $D7, $E7.
16: A crackle of sparks that chases him (the sparkle's sprites) -- OBJECT16
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 76 | 8, 8; 12 | $10 (to be drawn) | SPARK_CHASER |
17: A bug-eyed creature that wanders, on a lower half -- OBJECT17
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 94 | 7, 7; 12 | $10 (to be drawn) | WANDERER |
| 11 | 7, 7; 12 | $10 (to be drawn) | LOWER_HALF |
6 copies in 6 rooms, 1 of them raised by the nudge: $2F, $67, $89, $8A, $AB, $F8.
18: A bug-eyed creature that paces to and fro, on a lower half -- OBJECT18
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 86 | 7, 7; 12 | $10 (to be drawn) | PACER |
| 11 | 7, 7; 12 | $10 (to be drawn) | LOWER_HALF |
1 copy in 1 room: $A6.
19: A bug-eyed creature, the other view, that paces to and fro, on a lower half; mirrored -- OBJECT19
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 87 | 7, 7; 12 | $50 (to be drawn, mirrored) | PACER |
| 11 | 7, 7; 12 | $50 (to be drawn, mirrored) | LOWER_HALF |
20: A spiked dome that drops from the ceiling -- OBJECT20
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 73 | 8, 8; 12 | $14 (pushable, to be drawn) | CEILING_DROP |
25 copies in 4 rooms, 24 of them raised by the nudge: $0C, $1C, $58, $84.
21: A frozen spaceman: a cryonaut -- OBJECT21
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 74 | 8, 8; 24 | $10 (to be drawn) | CRYONAUT |
81 copies in 20 rooms: $0C, $1D, $28, $41, $4B, $4F, $65, $6E, $7A, $84, $8C, $8D, $94, $96, $99, $A5, $B6, $BA, $D6, $F8.
22: A frozen spaceman: a cryonaut; mirrored -- OBJECT22
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 74 | 8, 8; 24 | $50 (to be drawn, mirrored) | CRYONAUT |
51 copies in 13 rooms: $0A, $0C, $31, $41, $62, $65, $7A, $8C, $96, $A5, $AA, $B6, $D6.
23: Three cylinders on a plate, deadly -- OBJECT23
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 75 | 8, 8; 12 | $14 (pushable, to be drawn) | STILL_DEADLY |
168 copies in 27 rooms, 4 of them raised by the nudge: $04, $0B, $0C, $13, $1B, $31, $36, $37, $41, $42, $4B, $61, $62, $67, $6E, $7B, $8D, $94, $96, $99, $9A, $A5, $B5, $BA, $C6, $C8, $F8.
24: A domed socket on a plinth, for the valve of graphic 96 (a drum) -- OBJECT24
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 112 | 8, 8; 12 | $10 (to be drawn) | SOCKET |
| 108 | 8, 8; 12 | $12 (out of collisions, to be drawn) | SOCKET_SPARKLE |
6 copies in 6 rooms, 3 of them raised by the nudge: $0C, $28, $7A, $99, $A5, $B6.
25: A domed socket on a plinth, for the valve of graphic 97 (a cube) -- OBJECT25
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 113 | 8, 8; 12 | $10 (to be drawn) | SOCKET |
| 109 | 8, 8; 12 | $12 (out of collisions, to be drawn) | SOCKET_SPARKLE |
6 copies in 6 rooms, 3 of them raised by the nudge: $41, $62, $6E, $96, $AA, $D6.
26: A domed socket on a plinth, for the valve of graphic 98 (a point) -- OBJECT26
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 114 | 8, 8; 12 | $10 (to be drawn) | SOCKET |
| 110 | 8, 8; 12 | $12 (out of collisions, to be drawn) | SOCKET_SPARKLE |
6 copies in 6 rooms, 2 of them raised by the nudge: $1D, $31, $4B, $84, $8D, $94.
27: A domed socket on a plinth, for the valve of graphic 99 (a ball) -- OBJECT27
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 115 | 8, 8; 12 | $10 (to be drawn) | SOCKET |
| 111 | 8, 8; 12 | $12 (out of collisions, to be drawn) | SOCKET_SPARKLE |
6 copies in 6 rooms, 4 of them raised by the nudge: $0A, $4F, $65, $8C, $BA, $F8.
28: A clockwork mouse -- OBJECT28
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 116 | 7, 7; 12 | $10 (to be drawn) | CLOCKWORK_MOUSE |
9 copies in 7 rooms, 1 of them raised by the nudge: $3F, $42, $45, $4D, $72, $A9, $D8.
29: A domed column of rings that homes in on him -- OBJECT29
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 120 | 6, 6; 12 | $10 (to be drawn) | SLOW_CHASER |
30: A little domed robot with feelers: a remote-controlled robot -- OBJECT30
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 124 | 7, 7; 12 | $10 (to be drawn) | REMOTE_ROBOT |
9 copies in 8 rooms: $0B, $44, $56, $6A, $6B, $74, $8B, $D9.
33 (page 2, number 1): A box with an arrow on its lid: a remote-control button -- OBJECT33
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 122 | 8, 8; 12 | $10 (to be drawn) | REMOTE_BUTTON |
8 copies in 8 rooms: $0B, $44, $56, $6A, $6B, $74, $8B, $D9.
34 (page 2, number 2): A box with an arrow on its lid: a remote-control button; mirrored -- OBJECT34
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 122 | 8, 8; 12 | $50 (to be drawn, mirrored) | REMOTE_BUTTON |
8 copies in 8 rooms: $0B, $44, $56, $6A, $6B, $74, $8B, $D9.
35 (page 2, number 3): A box with an arrow on its lid, the other way: a remote-control button -- OBJECT35
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 123 | 8, 8; 12 | $10 (to be drawn) | REMOTE_BUTTON |
8 copies in 8 rooms: $0B, $44, $56, $6A, $6B, $74, $8B, $D9.
36 (page 2, number 4): A box with an arrow on its lid, the other way: a remote-control button; mirrored -- OBJECT36
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 123 | 8, 8; 12 | $50 (to be drawn, mirrored) | REMOTE_BUTTON |
8 copies in 8 rooms: $0B, $44, $56, $6A, $6B, $74, $8B, $D9.
37 (page 2, number 5): A plain block: the remote-control pad -- OBJECT37
| Graphic | Half U, V; height | Flags | Update routine |
|---|---|---|---|
| 128 | 8, 8; 12 | $10 (to be drawn) | REMOTE_PAD |
8 copies in 8 rooms: $0B, $44, $56, $6A, $6B, $74, $8B, $D9.