Prev: 8825 Up: Map Next: 885F
8835: Enemy movement: Determine action when out of screen
Used by the routine at L8A2D.
Input
IX Sprite data of enemy
handle_out_of_screen 8835 BIT 3,(IX+$07) If a flag is reset
8839 JR Z,handle_out_of_screen_1 Then skip ahead and determine what to do
This entry point is used by the routine at handle_out_of_screen_1.
handle_out_of_screen_0 883B LD (IX+$01),$2A Reset polar y back to center
883F LD (IX+$02),$00 Reset polar x
8843 LD (IX+$07),$40 Set flags
8847 RET Return to return_from_sprite_handler
handle_out_of_screen_1 8848 BIT 4,(IX+$07) Test flag
884C JR Z,handle_out_of_screen_2 If not set, skip ahead
884E RST $20 Random number
884F AND $03 0 - 3
8851 JR NZ,handle_out_of_screen_0 If not 0, jump back
handle_out_of_screen_2 8853 LD HL,active_enemies Decrement active enemies
8856 DEC (HL) ...
8857 LD HL,other_flags Set flag
885A SET 5,(HL) ...
885C JP deallocate_enemy Deallocate and return
Prev: 8825 Up: Map Next: 885F