summaryrefslogtreecommitdiff
path: root/game/microgames/flowers_delivery/player.gd
diff options
context:
space:
mode:
Diffstat (limited to 'game/microgames/flowers_delivery/player.gd')
-rw-r--r--game/microgames/flowers_delivery/player.gd24
1 files changed, 15 insertions, 9 deletions
diff --git a/game/microgames/flowers_delivery/player.gd b/game/microgames/flowers_delivery/player.gd
index 9f22d08..e0ea06f 100644
--- a/game/microgames/flowers_delivery/player.gd
+++ b/game/microgames/flowers_delivery/player.gd
@@ -1,15 +1,21 @@
extends AnimatedSprite3D
-func _ready() -> void:
- pass
+signal died
+var _died = false
func _process(delta: float) -> void:
- position.z -= delta * 3
+ if not _died:
+ position.z -= delta * 3
+
+ if Input.is_anything_pressed():
+ animation = "dodge"
+ offset.y = -100.0
+ else:
+ animation = "default"
+ offset.y = 0.0
- if Input.is_anything_pressed():
- animation = "dodge"
- offset.y = -100.0
- else:
- animation = "default"
- offset.y = 0.0
+ if ($Area3D as Area3D).has_overlapping_areas():
+ if animation == "default":
+ _died = true
+ died.emit()