Prev: F73A Up: Map Next: F773
F746: Room logic : Wally's House
F746 LD A,$08 Moving objects decrease endurance by 8.
F748 LD ($F26E),A
F74B LD IX,$F73A Point IX at the movement table. (F73A)
F74F LD B,$03 3 bulbs to draw.
F751 PUSH BC Store BC.
F752 LD BC,$F2F7 Point BC at the bounds table. (F2F7)
F755 CALL $EF35 Update moving objects.
F758 LD A,(IX-$01) Check the direction of the bulbs.
F75B CP $02 Is it still +2 ie: hasn't hit bounds?
F75D JR Z,$F767 Jump forward if it has.
The bulb has moved to the edge of the boundary. Rather than reversing direction as per usual, just reset the co-ordinates.
F75F LD (IX-$01),$02 Set the amount to change as 2 again.
F763 LD (IX-$03),$40 Set the Y co-ordinate to 40.
Now draw the lightbulb.
F767 LD A,$56 Set the ID to be the lightbulb. (8E38)
F769 CALL $A83D Draw the object.
F76C CALL $E329 Check for collision detection.
F76F POP BC Restore BC.
F770 DJNZ $F751 Loop until all the bulbs are updated.
F772 RET Return.
Prev: F73A Up: Map Next: F773