summaryrefslogtreecommitdiffstats
path: root/zoop_point.gd
blob: 44ff826513e45099ae27bc8fce1b45762a6372c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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