Cleanup and stuff

This commit is contained in:
Victor Turgeon
2023-10-11 01:46:51 -04:00
parent 1bcd7bcea9
commit b59b4eb4ba
6 changed files with 133 additions and 4 deletions

View File

@@ -84,7 +84,6 @@ func endAttack():
animatedSprite.play("default")
func receive_damage(dmg):
print(currentHp - dmg)
if !isAlive:
return
if currentHp - dmg <= 0:
@@ -102,7 +101,8 @@ func die():
isAlive = false
animatedSprite.stop()
animatedSprite.play("death")
animatedSprite.disconnect("animation_finished", endAttack)
if animatedSprite.is_connected("animation_finished", endAttack):
animatedSprite.disconnect("animation_finished", endAttack)
animatedSprite.connect("animation_finished", fadeOut)
func fadeOut():