From 92758c8c998091b8c2a20e6af5f2f473aa130d7a Mon Sep 17 00:00:00 2001 From: freddie-a <57713959+freddie-a@users.noreply.github.com> Date: Sat, 29 Oct 2022 21:59:06 +0100 Subject: Add health loss --- HealthBar.gd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 HealthBar.gd (limited to 'HealthBar.gd') diff --git a/HealthBar.gd b/HealthBar.gd new file mode 100644 index 0000000..ae4ce42 --- /dev/null +++ b/HealthBar.gd @@ -0,0 +1,18 @@ +extends ProgressBar + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +#func _process(delta): +# pass +func _on_player_hit(delta): + value -= delta * 20 -- cgit v1.2.3-70-g09d2