summaryrefslogtreecommitdiff
path: root/OverworldPath.gd
blob: 6ae7b8c5be8db9e31702a30411749646c276f720 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)