Prev: A964 Up: Map Next: A9A0
A985: Knock Player Back
Used by the routines at PlayerMovement and GamePlay_Start.
Starts the player flying after they have been hit, using the hit direction in A (taken from 9704). Bit 7 of the hit direction makes the player fall straight down instead (see KnockPlayerDown). A hit direction of 02 sends the player to the left (see KnockPlayerLeft) and otherwise the player is sent to the right. The sprite IDs 40 to 47 are then handled by HandlerFlyingSabreman, HandlerSittingSabreman and HandlerYellowOrchid_StandUp.
Input
A The hit direction
IX Actor record of the player
KnockPlayerBack A985 LD (IX+$02),$20 Set the hit counter of the player to 20.
A989 BIT 7,A Jump to KnockPlayerDown to make the player fall down if bit 7 is set.
A98B JR NZ,KnockPlayerDown
A98D LD (IX+$07),$00 Clear the Y velocity of the player.
A991 CP $02 Jump to KnockPlayerLeft if the player is to be sent to the left (the hit direction is 02).
A993 JR Z,KnockPlayerLeft
A995 LD (IX+$00),$40 Set the sprite ID of the player to 40 ("Sabreman: Flying Left").
A999 LD (IX+$06),$03 Set the X velocity of the player to 03 (moving right).
A99D JP DisplayActor Jump to DisplayActor to display the player.
Prev: A964 Up: Map Next: A9A0