added proper respawn (fixes #4)

This commit is contained in:
pennyrigate 2026-01-01 17:54:53 -05:00
parent 81b01b7508
commit 5ce3dc929b
2 changed files with 77 additions and 2 deletions

View file

@ -22,6 +22,7 @@ func _physics_process(delta: float) -> void:
func _on_hurtbox_area_entered(area: Area2D) -> void:
if can_die:
%DeathSound.play()
%AnimationPlayer.play("respawn")
position = startpos
CurrentGame.change_lives(-1)
can_die = false
@ -33,3 +34,8 @@ func _on_graze_box_area_entered(area: Area2D) -> void:
%GrazeParticles.emitting = true
CurrentGame.change_graze(1)
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
if anim_name == "respawn":
can_die = true