Prev: 7028 Up: Map Next: 70DB
7082: 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 7082 LD IX,$DAC8 IX=Sprite02_3Wide_X_Position.
7086 LD A,($5FBB) Jump to Handler_Frog01 if *RespawnFlag is zero.
7089 OR A
708A JR Z,Handler_Frog01
708C XOR A Write 00;
708D LD ($71E9),A
7090 LD ($71EC),A
Update the first frog.
Handler_Frog01 7093 LD HL,$71E9 Point HL at Frog1_StunCountdown.
7096 LD B,$88 Load B with the first frogs ground Y position (88).
7098 LD C,$3C Load C with the first frogs ground X position (3C).
709A CALL Update_Frog Call Update_Frog.
709D LD IY,$DAC8 Call CheckSpriteCollision with first sprite: Percy_X_Position against second sprite: Sprite02_3Wide_X_Position.
70A1 LD IX,$DAC0
70A5 CALL CheckSpriteCollision
70A8 JR C,Handler_Frog02 Jump to Handler_Frog02 if Percy isn't colliding with the second sprite.
Percy has collided with the first frog.
70AA LD A,$FF Write FF to *FallingState.
70AC LD ($5FA7),A
The first level only has a single frog and subsequent levels have two.
Handler_Frog02 70AF LD A,($5FB1) Jump to HandlerFrog01_CheckEggCollision if *CurrentLevel is equal to 01.
70B2 CP $01
70B4 JP Z,HandlerFrog01_CheckEggCollision
Update the second frog.
70B7 LD HL,$71EC Point HL at Frog2_StunCountdown.
70BA LD IX,$DACC IX=Sprite03_3Wide_X_Position.
70BE LD B,$78 Load B with the second frogs ground Y position (78).
70C0 LD C,$48 Load C with the second frogs ground X position (48).
70C2 CALL Update_Frog Call Update_Frog.
70C5 LD IX,$DAC0 Call CheckSpriteCollision with first sprite: Percy_X_Position against second sprite: Sprite03_3Wide_X_Position.
70C9 LD IY,$DACC
70CD CALL CheckSpriteCollision
70D0 JP C,HandlerFrog01_CheckEggCollision Jump to HandlerFrog01_CheckEggCollision if Percy isn't colliding with the second sprite.
Percy has collided with the second frog.
70D3 LD A,$FF Write FF to *FallingState.
70D5 LD ($5FA7),A
70D8 JP HandlerFrog01_CheckEggCollision Jump to HandlerFrog01_CheckEggCollision.
Prev: 7028 Up: Map Next: 70DB