Prev: 51802 Up: Map Next: 51849
51824: Handle Room Exit
Used by the routine at MovePlayer.
Sends the player to the next room if it has walked out through an arch. Only a player that is near an arch can leave the room, and not while it is still entering the room. The edge that counts is the one in the direction that the player is facing.
Input
IX Address of the object
Leave through the arch the player is facing, if it is near one.
HandleRoomExit 51824 LD A,(IX+12) Fetch the flags of the player.
51827 AND %11110000 Keep the counter of the player entering the room.
51829 RET NZ Return if the player is entering the room.
51830 BIT 0,(IX+7) Test whether the player is near an arch.
51834 RET Z Return if it is not.
51835 RES 0,(IX+7) Clear the flag.
51839 LD BC,51858 Point BC at RoomExitTable.
51842 LD HL,(23467) Fetch the size of the room in X and Y from RoomSizeX.
51845 PUSH HL Stack it for the routine to take off.
51846 JP SetPlayerSpeed_Direction Jump to the routine for the direction the player is facing.
View the equivalent code in;
Prev: 51802 Up: Map Next: 51849