Prev: 51052 Up: Map Next: 51113
51077: Nudge Objects To Arch
Used by the routine at HandleNearArch.
Nudges the player and the special objects towards the middle of a doorway, if they are close enough to the arch and are flagged to be adjusted. The way in which they are nudged is picked from the table at ArchDirectionTable, by the direction in which the arch faces.
Input
IX Address of the arch object
Nudge each nearby object towards the middle of the doorway.
NudgeObjectsToArch 51077 LD HL,3855 Set the distances that count as near to 15 in X and in Y.
51080 LD IY,23560 Point IY at ObjectsTable.
51084 LD DE,32 Set DE to the size of an object.
51087 LD B,4 Set the number of objects to 4, which is the player and the special objects.
This entry point is used by the routine at NudgeObjectNorthSouth.
NudgeObjectsToArch_Next 51089 LD A,(IY+0) Fetch the graphic number of the object.
51092 AND A Test whether there is an object.
51093 JR Z,NudgeObjectsToArch_Advance Jump to NudgeObjectsToArch_Advance if there is not.
51095 BIT 3,(IY+7) Jump to NudgeObjectsToArch_Advance if the object is not flagged to be adjusted near arches.
51099 JR Z,NudgeObjectsToArch_Advance
51101 CALL TestNearTo Test whether the object is near the arch.
51104 JR NC,NudgeObjectsToArch_Advance Jump to NudgeObjectsToArch_Advance if it is not.
51106 PUSH BC Stash the number of objects left on the stack.
51107 LD BC,51113 Point BC at ArchDirectionTable.
51110 JP SetPlayerSpeed_Direction Jump to the routine for the direction of the arch.
Prev: 51052 Up: Map Next: 51113