added proper respawn (fixes #4)
This commit is contained in:
parent
81b01b7508
commit
5ce3dc929b
2 changed files with 77 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue