From 78b6db9f792e18d848383856693cff4ef223a10f Mon Sep 17 00:00:00 2001 From: IcECreAm777 Date: Sat, 8 Jul 2023 16:43:32 +0200 Subject: checkpoint detection and UI --- Scripts/Checkpoint.gd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Scripts/Checkpoint.gd (limited to 'Scripts/Checkpoint.gd') diff --git a/Scripts/Checkpoint.gd b/Scripts/Checkpoint.gd new file mode 100644 index 0000000..ed10f74 --- /dev/null +++ b/Scripts/Checkpoint.gd @@ -0,0 +1,14 @@ +extends Node2D + + +var was_visited = false + +@onready var sprite : Sprite2D = $Sprite2D + + +func set_was_visited(visited: bool): + was_visited = visited + # TODO change the sprite to indicate the change + +func _on_area_2d_body_entered(body): + set_was_visited(true) -- cgit