Prev: 49112 Up: Map Next: 49196
49130: Handle Near Arch
The handler for the near side of an arch (object 2). As an arch does not move, its speeds are used to keep the position of the middle of the doorway: the middle is 13 further along the y axis than the arch, or 13 further back along the x axis if the sprite is flipped. The player is flagged if near the arch, and is nudged towards the middle of the doorway.
Input
IX The address of the object
Unflipped: doorway 13 along y.
HandleNearArch 49130 BIT 6,(IX+7) Jump to HandleNearArch_Flipped if the sprite is flipped.
49134 JR NZ,HandleNearArch_Flipped
49136 LD HL,63994 Set HL to 63994.
49139 CALL SetPixelAdjustments_Store Call SetPixelAdjustments_Store.
49142 LD A,(IX+2) Fetch the y position of the arch.
49145 ADD A,13 Add 13.
49147 LD (IX+10),A Set it as the y of the doorway middle.
49150 LD A,(IX+1) Fetch the x position of the arch.
49153 LD (IX+9),A Set it as the x of the doorway middle.
49156 LD HL,1551 Set HL to 1551.
Keep z and flag or nudge the player.
HandleNearArch_Near 49159 LD A,(IX+3) Fetch the z position of the arch.
49162 LD (IX+11),A Set it as the z of the doorway middle.
49165 CALL FlagPlayerNearArch Call FlagPlayerNearArch.
49168 JP NudgePlayerToArch Jump to NudgePlayerToArch.
Flipped: doorway 13 back along x.
HandleNearArch_Flipped 49171 LD HL,64246 Set HL to 64246.
49174 CALL SetPixelAdjustments_Store Call SetPixelAdjustments_Store.
49177 LD A,(IX+1) Fetch the x position of the arch.
49180 SUB 13 Subtract 13.
49182 LD (IX+9),A Set it as the x of the doorway middle.
49185 LD A,(IX+2) Fetch the y position of the arch.
49188 LD (IX+10),A Set it as the y of the doorway middle.
49191 LD HL,3846 Set HL to 3846.
49194 JR HandleNearArch_Near Jump to HandleNearArch_Near.
View the equivalent code in;
Prev: 49112 Up: Map Next: 49196