summaryrefslogtreecommitdiff
path: root/OverworldPath.gd
diff options
context:
space:
mode:
Diffstat (limited to 'OverworldPath.gd')
-rw-r--r--OverworldPath.gd33
1 files changed, 33 insertions, 0 deletions
diff --git a/OverworldPath.gd b/OverworldPath.gd
new file mode 100644
index 0000000..6ae7b8c
--- /dev/null
+++ b/OverworldPath.gd
@@ -0,0 +1,33 @@
+class_name OverworldPath
+extends Path2D
+
+
+@export var next_direction: Array[String] = [
+ "up", "down", "left", "right",
+]
+@export_node_path("OverworldPath") var _next_path: NodePath
+@export var previous_direction: Array[String] = [
+ "up", "down", "left", "right",
+]
+@export_node_path("OverworldPath") var _previous_path: NodePath
+
+
+var next_path: OverworldPath
+var previous_path: OverworldPath
+
+var progress: float:
+ set(value):
+ $PathFollow2D.progress_ratio = value
+ get:
+ return $PathFollow2D.progress_ratio
+
+var current_position: Vector2:
+ get:
+ return $PathFollow2D.position
+
+
+func _ready():
+ if _next_path:
+ next_path = get_node(_next_path)
+ if _previous_path:
+ previous_path = get_node(_previous_path)