summaryrefslogtreecommitdiff
path: root/Scripts/Level Specific/1FruitSrhubs.gd
diff options
context:
space:
mode:
authoraltaf-creator <dev@altafcreator.com>2025-10-20 01:43:48 +0800
committeraltaf-creator <dev@altafcreator.com>2025-10-20 01:43:48 +0800
commit466bec0b724632f6dd2e1555a7bd58ffc1dd0458 (patch)
treed6645ea11914edeec645299fa497a9e542dbaec7 /Scripts/Level Specific/1FruitSrhubs.gd
Jam version.
Diffstat (limited to 'Scripts/Level Specific/1FruitSrhubs.gd')
-rw-r--r--Scripts/Level Specific/1FruitSrhubs.gd14
1 files changed, 14 insertions, 0 deletions
diff --git a/Scripts/Level Specific/1FruitSrhubs.gd b/Scripts/Level Specific/1FruitSrhubs.gd
new file mode 100644
index 0000000..ee38b61
--- /dev/null
+++ b/Scripts/Level Specific/1FruitSrhubs.gd
@@ -0,0 +1,14 @@
+extends Node2D
+
+@export var area : Area2D
+@export var fruites : Node2D
+@export var health = 3
+
+func _on_area_2d_body_entered(body:Node2D) -> void:
+ if body is Entity:
+ if body.is_player:
+ body.health += health
+ body.health = min(body.health, body.max_health)
+ UIConnector.display_health(body.health)
+ area.queue_free()
+ fruites.queue_free()