Prev: EF91 Up: Map Next: F046
EFC7: Action 9 CHASE. Drop down to the "shark chase" game
EFC7 LD A,(IY+$05) Get the X co-ordinate.
EFCA SUB $08 Move back 8 columns.
EFCC CP $E0 If the co-ordinate is greater than E0 then set it to that.
EFCE JR C,$EFD2
EFD0 LD A,$E0
EFD2 SRL A Divide it by 8 and set the result in E as the column to draw at.
EFD4 SRL A
EFD6 SRL A
EFD8 LD E,A
EFD9 LD D,$17 Set the row to 17.
EFDB LD HL,$7F16 Point HL at the data for the hole.
EFDE CALL $B82B Patch the display to overwrite graphics.
A hole has opened, so drop the player down to it.
EFE1 LD A,(IY+$0A) Get the Y co-ordinate.
EFE4 ADD A,$04 Drop down four rows.
EFE6 CP $A0 If the co-ordinate is creater than A0 set it to that.
EFE8 JR C,$EFEC
EFEA LD A,$A0
EFEC LD (IY+$0A),A Set the new Y co-ordinate.
EFEF CALL $81AE Move everything on screen.
EFF2 LD A,(IY+$0A) Get the Y co-ordinate.
EFF5 CP $A0 Is it A0?
EFF7 JR NZ,$EFE1 Jump back if not to fall some more.
The player has fallen into the hole, so update for the chase sequence.
EFF9 LD (IY+$00),$00 Set the frame counter to 0.
EFFD LD A,(IY-$3C) Get the current direction of the sprite. (BC2B)
F000 OR A Is it 0 (left)?
F001 CALL NZ,$81D4 If not, need to flip the sprite around to be left-facing.
F004 LD A,$F0 Set the shark's X co-ordinate to F0.
F006 LD ($F0BD),A
F009 LD HL,$F0B7 Point HL directly at the background graphics. (F0B7)
F00C CALL $B902 Clear the playing area.
F00F CALL $B969 Draw the background graphics.
F012 LD (IY+$05),$DA Set the X co-ordinate to DA.
F016 LD (IY+$0A),$3C Set the Y co-ordinate to 3C.
F01A LD A,(IY+$0A) Get the Y co-ordinate.
F01D CP $98 Is the player on the ground yet?
F01F JR Z,$F026 Jump forward if so.
F021 ADD A,$04 Otherwise just drop down a row.
F023 LD (IY+$0A),A
F026 CALL $EEA2 Initialize the sprite buffers.
F029 CALL $F057 Update the shark.
F02C CALL $F0C0 Check for player movement.
F02F CALL $B0E6 Update the sprite buffer.
F032 CALL $B9FB Put the sprites on screen.
F035 LD A,(IY+$05) Get the Y co-ordinate.
F038 OR A Is it 0?
F039 JR NZ,$F01A Jump back if it's not.
F03B LD (IY+$0F),$1F Set the Y co-ordinate to 1F.
F03F LD (IY+$05),$F0 Set the X co-ordinate to F0.
F043 JP $EE8D Move to the sewer.
Prev: EF91 Up: Map Next: F046