Prev: 51617 Up: Map Next: 51742
51707: Set Player Speed
Used by the routine at MovePlayer.
Sets the speeds along x and y of the player to walk forward. The adjustments of the speeds that arches make to nudge the player into doorways are added first, then the speed of 3 in the direction that the player is facing.
Input
IX The address of the object
Add the doorway nudges.
SetPlayerSpeed 51707 LD A,(IX+9) Fetch the speed along the x axis.
51710 ADD A,(IX+14) Add the adjustment along x.
51713 LD (IX+9),A Store the speed along the x axis.
51716 LD A,(IX+10) Fetch the speed along the y axis.
51719 ADD A,(IX+15) Add the adjustment along y.
51722 LD (IX+10),A Store the speed along the y axis.
51725 XOR A Write 0 to the adjustments along x and y.
51726 LD (IX+14),A
51729 LD (IX+15),A
Jump by the facing direction.
51732 LD BC,51762 Point BC at PlayerMovementTable.
This entry point is used by the routines at NudgeObjectsToArch and HandleRoomExit.
SetPlayerSpeed_Direction 51735 CALL GetFacingDirection Fetch the direction the player is facing.
51738 LD L,A Copy it to L.
51739 JP RunGame_JumpToHandler Jump to the routine for the direction.
View the equivalent code in;
Prev: 51617 Up: Map Next: 51742