Prev: 45423 Up: Map Next: 45523
45476: Animate Crater
Step a crater sprite, then stamp terrain when the frame reaches 200.
Input
IX Actor slot
Step the crater frame on even frames, then stamp the terrain when it reaches 200.
AnimateCrater 45476 CALL DrawCurrentActor_Draw Call DrawCurrentActor_Draw.
45479 LD A,(24130) Fetch GameTimer.
45482 AND %00000001 Keep only bit 0.
45484 RET NZ Return if this is an odd frame.
45485 INC (IX+0) Increase the actor type by one.
45488 LD A,(IX+0) Fetch the actor type.
45491 CP 200 Return if it is not 200.
45493 RET NZ
Stamp the crater into the terrain and change the actor type.
45494 CALL StampTerrainTile Call StampTerrainTile.
45497 LD (IX+0),99 Write 99 to the actor type.
Return unless this actor is in Jetman's slot.
45501 PUSH IX Copy the slot pointer into HL (using the stack).
45503 POP HL
45504 LD BC,24696 Set BC to Jetman's slot address Jetman_Slot.
45507 AND A Clear the carry flag.
45508 SBC HL,BC Subtract Jetman's slot address.
45510 RET NZ Return if this is not Jetman.
45511 CALL DrawCachedSprite Call DrawCachedSprite.
45514 LD (IX+0),129 Write 129 to the actor type.
45518 LD (IX+5),64 Write 64 to the actor speed.
45522 RET Return.
Prev: 45423 Up: Map Next: 45523