Prev: 43364 Up: Map Next: 43424
43397: 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 38660). Bit 7 of the hit direction makes the player fall straight down instead (see KnockPlayerDown). A hit direction of 2 sends the player to the left (see KnockPlayerLeft) and otherwise the player is sent to the right. The sprite IDs 64 to 71 are then handled by HandlerFlyingSabreman, HandlerSittingSabreman and HandlerYellowOrchid_StandUp.
Input
A The hit direction
IX Actor record of the player
KnockPlayerBack 43397 LD (IX+2),32 Set the hit counter of the player to 32.
43401 BIT 7,A Jump to KnockPlayerDown to make the player fall down if bit 7 is set.
43403 JR NZ,KnockPlayerDown
43405 LD (IX+7),0 Clear the Y velocity of the player.
43409 CP 2 Jump to KnockPlayerLeft if the player is to be sent to the left (the hit direction is 2).
43411 JR Z,KnockPlayerLeft
43413 LD (IX+0),64 Set the sprite ID of the player to 64 ("Sabreman: Flying Left").
43417 LD (IX+6),3 Set the X velocity of the player to 3 (moving right).
43421 JP DisplayActor Jump to DisplayActor to display the player.
Prev: 43364 Up: Map Next: 43424