Prev: 50717 Up: Map Next: 50829
50794: Set Player Speed
Used by the routine at MovePlayer.
Gives the player a speed of three along the direction that it faces, after adding any speed that something else has pushed it with, which comes from the two bytes of the object that hold the push. Those bytes are also where arches write the nudge into a doorway. NudgeObjectsToArch uses SetPlayerSpeed_JumpByFacing with a different table.
Input
IX The address of the object
Add the doorway nudges.
SetPlayerSpeed 50794 LD A,(IX+9) Fetch the speed along the x axis.
50797 ADD A,(IX+14) Add the adjustment along x.
50800 LD (IX+9),A Store the speed along the x axis.
50803 LD A,(IX+10) Fetch the speed along the y axis.
50806 ADD A,(IX+15) Add the adjustment along y.
50809 LD (IX+10),A Store the speed along the y axis.
50812 XOR A Write 0 to the adjustments along x and y.
50813 LD (IX+14),A
50816 LD (IX+15),A
Jump by the facing direction.
50819 LD BC,50829 Take the table of the four routines that add the speed, WalkingRoutines.
This entry point is used by the routine at NudgeObjectsToArch.
SetPlayerSpeed_JumpByFacing 50822 CALL GetFacingDirection Call GetFacingDirection to find out which way the player is facing.
50825 LD L,A Use the direction as the index into the table.
50826 JP RunGame_JumpViaTable Jump to RunGame_JumpViaTable to run the routine for the direction.
View the equivalent code in;
Prev: 50717 Up: Map Next: 50829