From 04ecbdb00a8e2df5778945ff8d34bea53b8ad09f Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 5 Dec 2025 12:47:56 +0200 Subject: Add zooping --- zoop_point.gd | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 zoop_point.gd (limited to 'zoop_point.gd') diff --git a/zoop_point.gd b/zoop_point.gd new file mode 100644 index 0000000..44ff826 --- /dev/null +++ b/zoop_point.gd @@ -0,0 +1,15 @@ +class_name ZoopPoint +extends Node2D + +@export_enum("left", "right") var orientation: String + +func _ready(): + $Sprite2D.flip_h = orientation == "left" + +func _camera_target() -> Vector2: + var off: Vector2 + if orientation == "left": off = Vector2(-20, 0) + elif orientation == "right": off = Vector2(20, 0) + else: assert(false, "invalid orientation") + + return global_position + off -- cgit v1.3