WinterLicht / Chaos-Projectile

Run ‘n’ Gun meets RPG
60 stars 17 forks source link

Ownerless projectiles remain on the screen forever #9

Open Funatiker opened 8 years ago

Funatiker commented 8 years ago

Sometimes enemies shoot projectiles while (?) dying. In that case, it might happen that a projectile remains on screen. It stops moving when the death-animation has finished but it won't disappear but stays animated (although not harmful anymore).

Ownerless projectile 1 Ownerless projectile 2 Ownerless projectile 3 Ownerless projectile 4 Ownerless projectile 5

Funatiker commented 8 years ago

@WinterLicht is it possible that check_to_deactivate() (statesystem) activates dead enemies and makes them shoot projectiles after the death animation has been started?

Edit: I've written a bit of debug code: debugcode.txt

It indicates that statesystem.py actually re-activates dead AIs:

$ python game.py HELP I DIED 60 HELP I DIED 59 HELP I DIED 57 HELP I DIED 58 I am the statesystem and I am activating a dead ai. Really. Not kidding 58

I added of more line of print()-debugging and now I see that the AI sometimes tries to attack after dying.

debugcode2.txt

$ python game.py HELP I DIED 60 HELP I DIED 59 HELP I DIED 57 I am the statesystem and I am activating a dead ai. Really. Not kidding 57 I just tried to attack although I am DEAD. WHUT? I just tried to attack although I am DEAD. WHUT? I just tried to attack although I am DEAD. WHUT? I just tried to attack although I am DEAD. WHUT? I just tried to attack although I am DEAD. WHUT? I just tried to attack although I am DEAD. WHUT? I just tried to attack although I am DEAD. WHUT? HELP I DIED 58 HELP I DIED 60 I am the statesystem and I am activating a dead ai. Really. Not kidding 60 I just tried to attack although I am DEAD. WHUT? HELP I DIED 59 HELP I DIED 58 HELP I DIED 57