Prev: C8AD Up: Map Next: C8F7
C8D2: Nudge Objects To Arch
Used by the routine at HandleNearArch.
Gives the player a small push towards the middle of a door, when it is standing in front of it. The push is along x or y, depending on the direction that the player is facing and the type of the door. That way the player does not have to line up exactly to go through.
Input
IX Door record
Return unless the player is in front of the door.
NudgeObjectsToArch C8D2 LD HL,$0F0F Set the size of the box in front of the door in HL to 0F along both x and y.
C8D5 LD IY,$A76F Start with the first object record, ObjectsTable, which is the legs of the player.
C8D9 LD A,(IY+$00) Return if the legs are not in use.
C8DC AND A
C8DD RET Z
C8DE BIT 3,(IY+$07) Return if the player cannot open doors.
C8E2 RET Z
C8E3 CALL TestNearTo Return if the player is not in front of the door.
C8E6 RET NC
Push towards the middle of the door.
C8E7 LD BC,$C8F7 Take the table of routines for type 08, DoorPushRoutines.
C8EA BIT 3,(IX+$00) Jump to SetPlayerSpeed_JumpByFacing to run the routine for the direction if the door is type 08.
C8EE JP NZ,SetPlayerSpeed_JumpByFacing
C8F1 LD BC,$C8FF Take the table of routines for type 06, DoorPushRoutines_Type06.
C8F4 JP SetPlayerSpeed_JumpByFacing Jump to SetPlayerSpeed_JumpByFacing to run the routine for the direction.
View the equivalent code in;
Prev: C8AD Up: Map Next: C8F7