Prev: 28712 Up: Map Next: 28891
28802: Handler: Frogs
Used by the routine at Run_Main_Loop_Body.
Handles the frog enemies. Each frog sits on the ground and periodically jumps upward in an arc, making a croaking sound.
Set up the first frog.
Handler_Frogs 28802 LD IX,56008 IX=Sprite02_3Wide_X_Position.
28806 LD A,(24507) Jump to Handler_Frog01 if *RespawnFlag is zero.
28809 OR A
28810 JR Z,Handler_Frog01
28812 XOR A Write 0;
28813 LD (29161),A
28816 LD (29164),A
Update the first frog.
Handler_Frog01 28819 LD HL,29161 Point HL at Frog1_StunCountdown.
28822 LD B,136 Load B with the first frogs ground Y position (136).
28824 LD C,60 Load C with the first frogs ground X position (60).
28826 CALL Update_Frog Call Update_Frog.
28829 LD IY,56008 Call CheckSpriteCollision with first sprite: Percy_X_Position against second sprite: Sprite02_3Wide_X_Position.
28833 LD IX,56000
28837 CALL CheckSpriteCollision
28840 JR C,Handler_Frog02 Jump to Handler_Frog02 if Percy isn't colliding with the second sprite.
Percy has collided with the first frog.
28842 LD A,255 Write 255 to *FallingState.
28844 LD (24487),A
The first level only has a single frog and subsequent levels have two.
Handler_Frog02 28847 LD A,(24497) Jump to HandlerFrog01_CheckEggCollision if *CurrentLevel is equal to 1.
28850 CP 1
28852 JP Z,HandlerFrog01_CheckEggCollision
Update the second frog.
28855 LD HL,29164 Point HL at Frog2_StunCountdown.
28858 LD IX,56012 IX=Sprite03_3Wide_X_Position.
28862 LD B,120 Load B with the second frogs ground Y position (120).
28864 LD C,72 Load C with the second frogs ground X position (72).
28866 CALL Update_Frog Call Update_Frog.
28869 LD IX,56000 Call CheckSpriteCollision with first sprite: Percy_X_Position against second sprite: Sprite03_3Wide_X_Position.
28873 LD IY,56012
28877 CALL CheckSpriteCollision
28880 JP C,HandlerFrog01_CheckEggCollision Jump to HandlerFrog01_CheckEggCollision if Percy isn't colliding with the second sprite.
Percy has collided with the second frog.
28883 LD A,255 Write 255 to *FallingState.
28885 LD (24487),A
28888 JP HandlerFrog01_CheckEggCollision Jump to HandlerFrog01_CheckEggCollision.
Prev: 28712 Up: Map Next: 28891