Back to Skool Routines
Prev: 64316 Up: Map Next: 64460
64416: Deal with ERIC when falling to floor to land on feet
Called by the routine at 63405 when bit 3 at 32749 is set (by the routine at 64259 or 64316).
64416 LD HL,32755 32755 holds ERIC's animation timer
64419 DEC (HL) Is it time to deal with ERIC yet?
64420 RET NZ Return if not
64421 EX DE,HL
64422 LD HL,53762 Point HL at byte 2 of ERIC's buffer
64425 INC (HL) Increment ERIC's y-coordinate temporarily (for testing purposes)
64426 CALL 30543 Has ERIC reached the floor yet?
64429 JR NZ,64452 Jump if not
64431 CP 17 17=y-coordinate of the bottom floor
64433 DEC HL Point HL at byte 1 of ERIC's buffer
64434 JR Z,64441 Jump if ERIC has landed on the bottom floor
64436 LD A,(HL) A=ERIC's x-coordinate
64437 CP 95 95=x-coordinate of the rightmost end of the boys' skool
64439 JR NC,64451 Jump if ERIC is outside the boys' skool
64441 EX DE,HL Reset all of ERIC's status flags at 32749 and 32763, indicating that ERIC has landed safely
64442 LD L,237
64444 LD (HL),0
64446 LD L,251
64448 LD (HL),0
64450 EX DE,HL
64451 INC L L=2
64452 DEC (HL) Restore ERIC's y-coordinate (we've finished testing)
64453 CALL 25012 Update SRB for ERIC's current animatory state and location
64456 INC D Increment ERIC's y-coordinate (i.e. make him drop one level)
64457 JP 62231 Update SRB for ERIC's new location, and reset ERIC's animation timer at 32755 to 6
Prev: 64316 Up: Map Next: 64460