diff options
| author | Jan Tuomi <jan@jantuomi.fi> | 2025-12-05 12:47:56 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan@jantuomi.fi> | 2025-12-05 13:01:03 +0200 |
| commit | 04ecbdb00a8e2df5778945ff8d34bea53b8ad09f (patch) | |
| tree | 4b6d3a8de0d48d214738f8c1f6826d8002c276a0 /zoop_point.gd | |
| parent | 9e9f6984a500ec6eab02fa651eaaf3472c281c2a (diff) | |
Add zooping
Diffstat (limited to 'zoop_point.gd')
| -rw-r--r-- | zoop_point.gd | 15 |
1 files changed, 15 insertions, 0 deletions
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 |
