Prev: 644D Up: Map Next: 646D
645D: Door: 07 / 00
The doorway between the top wall of room 07 and the bottom wall of room 00. Doors are made of two 8-byte room items, one in each of the rooms that they join, which are the two halves of the door (see GetOtherDoorHalf). Each half is in the list of items for its room (see RoomTable). The other doors, and the other pairs of items that follow, are laid out in the same way.
Offset Description
00 Graphic ID (also the index of the handler in HandlerTable2)
01 Room ID
02 Exit offsets
03 X position
04 Y position
05 Attribute (bits 5-7 are the orientation, see DrawGraphic)
06 Obstacle X
07 Obstacle Y
The exit offsets are used by EnterDoor to put the player to the right of, and above, the position of the half that they come out of: the number of pixels to the right is twice the bottom four bits, and the number of pixels above is twice the top four bits. CheckObstacles uses the two obstacle bytes to make a rectangle, as long as bit 3 of the attribute is reset. An entity in the rectangle is blocked if bit 2 of the attribute is set, and is not blocked if it is reset. The left edge is in the top four bits of the X byte, and the top edge is in the top four bits of the Y byte (both signed). The width and height are in the bottom four bits of each. They are all in units of four pixels.
Door_07_00 645D DEFB $02 Graphic ID: "Door Frame".
645E DEFB $07 Room: 07.
645F DEFB $34 Exit offsets: 34.
6460 DEFB $50 X position: 50.
6461 DEFB $1F Y position: 1F.
6462 DEFB $00 Attribute: 00.
6463 DEFB $04 Obstacle X: 04.
6464 DEFB $56 Obstacle Y: 56.
6465 DEFB $02 Graphic ID: "Door Frame".
6466 DEFB $00 Room: 00.
6467 DEFB $34 Exit offsets: 34.
6468 DEFB $50 X position: 50.
6469 DEFB $B7 Y position: B7.
646A DEFB $80 Attribute: 80.
646B DEFB $04 Obstacle X: 04.
646C DEFB $06 Obstacle Y: 06.
Prev: 644D Up: Map Next: 646D