15 lines
436 B
GDScript
15 lines
436 B
GDScript
extends Node2D
|
|
|
|
var health = 100.0
|
|
|
|
func _on_area_2d_area_entered(area: Area2D) -> void:
|
|
CurrentGame.change_score(100)
|
|
%HurtSound.play()
|
|
health -= 0.25
|
|
print(%Movements.current_animation)
|
|
if health < 50.0 && health >= 25.0 && %Movements.current_animation != "midway_left":
|
|
%Movements.play("midway_left")
|
|
|
|
if health < 25.0 && %Movements.current_animation != "pinch":
|
|
%Movements.play("pinch")
|
|
%AnimationPlayer.play("hurt")
|