Prev: ADEA Up: Map Next: AE78
AE37: Handler: Missile Spawner
Draw the actor and step its type through 98-9B (every 8th frame) or 9C-9F (every 4th frame). On reaching 9B or 9F it spawns a sideways missile. Types 9B and 9F only draw.
Input
IX Actor slot
Handler_MissileSpawner AE37 JP DrawCurrentActor_Draw Jump to DrawCurrentActor_Draw.
Animate types 98-9B every 8th frame, spawning the left missile when the type reaches 9B.
Handler_MissileSpawner_AnimateLeft AE3A LD E,$18 E=18.
AE3C CALL TickThenExplode_TestJetman Call TickThenExplode_TestJetman.
AE3F CALL C,TickThenExplode_KillJetman Call TickThenExplode_KillJetman if this actor is close enough.
AE42 CALL DrawCurrentActor_Draw Call DrawCurrentActor_Draw.
Return unless this is every eighth frame.
AE45 LD A,($5E42) Fetch GameTimer.
AE48 AND %00000111 Keep only bits 0-2.
AE4A RET NZ Return if the result is not zero.
Step the type, then spawn a missile once it reaches 9B.
AE4B INC (IX+$00) Increase the actor type by one.
AE4E LD A,(IX+$00) Fetch the actor type.
AE51 AND %00000011 Keep only bits 0-1.
AE53 CP $03 Call Handler_Missile_CopyTemplate if those bits are 03.
AE55 CALL Z,Handler_Missile_CopyTemplate
AE58 RET Return.
Animate types 9C-9F every 4th frame, spawning the right missile when the type reaches 9F.
Handler_MissileSpawner_AnimateRight AE59 LD E,$18 E=18.
AE5B CALL TickThenExplode_TestJetman Call TickThenExplode_TestJetman.
AE5E CALL C,TickThenExplode_KillJetman Call TickThenExplode_KillJetman if this actor is close enough.
AE61 CALL DrawCurrentActor_Draw Call DrawCurrentActor_Draw.
Return unless this is every fourth frame.
AE64 LD A,($5E42) Fetch GameTimer.
AE67 AND %00000011 Keep only bits 0-1.
AE69 RET NZ Return if the result is not zero.
Step the type, then spawn a missile once it reaches 9F.
AE6A INC (IX+$00) Increase the actor type by one.
AE6D LD A,(IX+$00) Fetch the actor type.
AE70 AND %00000011 Keep only bits 0-1.
AE72 CP $03 Call Handler_Missile_CopyTemplate2 if those bits are 03.
AE74 CALL Z,Handler_Missile_CopyTemplate2
AE77 RET Return.
Prev: ADEA Up: Map Next: AE78