Prev: F251 Up: Map Next: F2CD
F26D: Room Event : Spooky Hand.
Used by the routine at Update_Room00.
Input
Output
Handler_SpookyHand F26D LD HL,SpookyHand check count down, animating hand if already zero.
F270 LD A,(HL)
F271 OR A
F272 JR Z,Handler_SpookyHand_Update
F274 DEC (HL) Decrease countdown, reutrn if not zero.
F275 RET NZ
F276 LD A,(Wally_RoomNo) Get data for current room with a spooky hand. (Assumes this routine is only called by rooms that match.)
F279 LD B,A
F27A LD HL,SpookyHand_PosTable
Handler_SpookyHand_0 F27D LD A,(HL)
F27E INC HL
F27F INC HL
F280 INC HL
F281 CP B
F282 JR NZ,Handler_SpookyHand_0
F284 DEC HL Get position of spooky hand and draw for the first time.
F285 LD D,(HL)
F286 DEC HL
F287 LD E,(HL)
F288 LD (BitmapX),DE
F28C LD A,$AD
F28E LD (SpookyHand_Frame),A
F291 CALL Bitmap16Draw
F294 RET
Update spooky hand for animation.
Handler_SpookyHand_Update F295 LD HL,SpookyHand_f26c Check delay for a frame, exit if not ready to update.
F298 DEC (HL)
F299 RET NZ
F29A LD (HL),$03 Set frame delay.
F29C LD A,(Wally_RoomNo)
F29F LD HL,SpookyHand_PosTable Get position.
Handler_SpookyHand_1 F2A2 CP (HL)
F2A3 INC HL
F2A4 INC HL
F2A5 INC HL
F2A6 JR NZ,Handler_SpookyHand_1
F2A8 DEC HL
F2A9 LD D,(HL)
F2AA DEC HL
F2AB LD E,(HL)
F2AC EX DE,HL
F2AD LD (BitmapX),HL
F2B0 LD A,(SpookyHand_Frame) Erase Hand.
F2B3 CALL Bitmap16Draw
F2B6 INC A Next frame.
F2B7 CP $B3 Check for end of animation, restarting countdown if end reached.
F2B9 JR NZ,Handler_SpookyHand_2
F2BB LD A,$32
F2BD LD (SpookyHand),A
F2C0 RET
Handler_SpookyHand_2 F2C1 LD (SpookyHand_Frame),A Draw next frame.
F2C4 CALL Bitmap16Draw
F2C7 LD B,$02 Check to see if Wally has been grabbed, decreasing by 2 points if so.
F2C9 CALL Wally_HitTest
F2CC RET
Prev: F251 Up: Map Next: F2CD