Prev: DC79 Up: Map Next: DCDC
DCA8: Speed Player Up
Used by the routine at MovePlayer.
Raises the speed of the player half of the way towards the maximum speed, keeping it even, and then moves the player.
SpeedPlayerUp DCA8 LD A,($BBBE) Work out the new speed, which is the average of the current speed and the maximum speed (MaximumSpeed), made even.
DCAB SUB (IX+$05)
DCAE SRL A
DCB0 ADD A,(IX+$05)
DCB3 AND $FE
This entry point is used by the routine at SlowPlayerDown.
Set the speed, move the player and animate the legs.
MovePlayer_Speed DCB5 LD (IX+$05),A Set the speed of the player.
DCB8 CALL SetVelocityFromSpeed Set the velocity of the player from its speed and direction.
DCBB CALL TestMove Test whether the move is blocked by the scenery.
DCBE CALL MoveObject Move the player.
DCC1 CALL MarkCellVisited Mark the cell that the player is in as visited.
DCC4 CALL PlayMovementSound Play the sound for walking.
DCC7 LD A,(IX+$00) Move on to the next sprite for the legs, from 00 to 05.
DCCA LD C,A
DCCB INC A
DCCC AND $07
DCCE CP $06
DCD0 JR C,MovePlayer_SetLegs
DCD2 XOR A Clear the sprite number if it went past 05.
MovePlayer_SetLegs DCD3 LD B,A Set the type of the legs.
DCD4 LD A,C
DCD5 AND $F8
DCD7 OR B
DCD8 LD (IX+$00),A
DCDB RET Return.
View the equivalent code in;
Prev: DC79 Up: Map Next: DCDC