Prev: 63709 Up: Map Next: 63730
63711: Move Player
Used by the routines at Action_North, Action_South, Action_East, Action_West and Action_Up.
The data in Table_RoomMap is stored in a particular order for each room:
Offset Exit To Room
0 North
1 South
2 East
3 West
4 Up
5 Down
This is how the movement works; taking the current room from the map - we add a "movement value" (e.g. "East" which is 2) - this then points to data in the table which correlates to either a room number for the exit, or 0 to indicate there is no exit in that direction.
Input
C A movement "value" from the action
MovePlayer 63711 CALL Parser_ValidateNoDirectObject Call Parser_ValidateNoDirectObject.
Directional commands can only be called on their own.
Other commands like "GO" and "SWIM" are just treated like aliases, where the second token (the direction) is shunted down to being the first token, and the second token is then just erased: RemoveUserInput_Token_1.
63714 RET C Return if there's any token set in UserInput_Token_2.
63715 LD B,0 Initialise B with 0 so the movement value is now in BC.
63717 CALL GetRoomPointer Call GetRoomPointer.
HL now holds a pointer to the room data for the current room at Table_RoomMap.
63720 ADD HL,BC Add the movement value to HL.
63721 LD A,(HL) Fetch the entry from *HL and store it in A.
63722 OR A Jump to Response_YouCantGoInThatDirection if there is no exit at the requested memory location.
63723 JP Z,Response_YouCantGoInThatDirection
63726 CALL 60176 Call 60176.
63729 RET Return.
Prev: 63709 Up: Map Next: 63730