summaryrefslogtreecommitdiff
path: root/Scenes/Entities/Enemies/Tree.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-04-27 20:06:49 +0200
committerDaniel Weipert <git@mail.dweipert.de>2024-04-27 20:06:49 +0200
commit81cc6f1d22677dd4a60aa9377c91b291bf10e523 (patch)
tree9c22712a9746ed0598a44be6e88727d021436860 /Scenes/Entities/Enemies/Tree.gd
parentc8a316e4b8987dad963656a34665fa0e23dedcb1 (diff)
update
Diffstat (limited to 'Scenes/Entities/Enemies/Tree.gd')
-rw-r--r--Scenes/Entities/Enemies/Tree.gd22
1 files changed, 22 insertions, 0 deletions
diff --git a/Scenes/Entities/Enemies/Tree.gd b/Scenes/Entities/Enemies/Tree.gd
new file mode 100644
index 0000000..7c87a18
--- /dev/null
+++ b/Scenes/Entities/Enemies/Tree.gd
@@ -0,0 +1,22 @@
+extends CharacterBody2D
+
+
+func _ready():
+ add_to_group("enemies")
+
+ get_node("Collision").init()
+
+ set_physics_process(false)
+ $AnimatedSprite2D.play("spawn")
+ $AnimatedSprite2D.stop()
+ $AnimatedSprite2D.set_frame_and_progress(0, 0)
+
+
+func _physics_process(delta):
+ get_node("Movement").physics_process(delta)
+
+
+func _on_detection_body_entered(body):
+ $AnimatedSprite2D.play("spawn")
+ await $AnimatedSprite2D.animation_finished
+ set_physics_process(true)