Prev: B16F Up: Map Next: B1D3
B1A4: Animate Crater
Step a crater sprite, then stamp terrain when the frame reaches C8.
Input
IX Actor slot
Step the crater frame on even frames, then stamp the terrain when it reaches C8.
AnimateCrater B1A4 CALL DrawCurrentActor_Draw Call DrawCurrentActor_Draw.
B1A7 LD A,($5E42) Fetch GameTimer.
B1AA AND %00000001 Keep only bit 0.
B1AC RET NZ Return if this is an odd frame.
B1AD INC (IX+$00) Increase the actor type by one.
B1B0 LD A,(IX+$00) Fetch the actor type.
B1B3 CP $C8 Return if it is not C8.
B1B5 RET NZ
Stamp the crater into the terrain and change the actor type.
B1B6 CALL StampTerrainTile Call StampTerrainTile.
B1B9 LD (IX+$00),$63 Write 63 to the actor type.
Return unless this actor is in Jetman's slot.
B1BD PUSH IX Copy the slot pointer into HL (using the stack).
B1BF POP HL
B1C0 LD BC,$6078 Set BC to Jetman's slot address Jetman_Slot.
B1C3 AND A Clear the carry flag.
B1C4 SBC HL,BC Subtract Jetman's slot address.
B1C6 RET NZ Return if this is not Jetman.
B1C7 CALL DrawCachedSprite Call DrawCachedSprite.
B1CA LD (IX+$00),$81 Write 81 to the actor type.
B1CE LD (IX+$05),$40 Write 40 to the actor speed.
B1D2 RET Return.
Prev: B16F Up: Map Next: B1D3