fixed multiple death bug

This commit is contained in:
pennyrigate 2023-01-27 05:53:14 -05:00
parent eaa99f7e74
commit e541e6ea5e

View file

@ -297,6 +297,8 @@ func die():
new_particles.global_position = global_position
new_particles.emitting = true
sprite.visible = false
current_state = State.INACTIVE
position = Game.respawn_point
Game.lives -= 1
if Game.lives < 0:
new_particles.amount = 64
@ -313,7 +315,6 @@ func die():
else:
Game.play_sound(Game.a_die, Game.ac_die)
yield(Game.freeze_frame(0.3), "timeout")
position = Game.respawn_point
current_state = State.IDLE
sprite.visible = true