aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar perivesta <>2023-07-09 15:53:42 +0200
committerLibravatar perivesta <>2023-07-09 15:53:42 +0200
commit317e16b1f99036275ac27f850314df5a965526a9 (patch)
tree018af2b26448be789c30e576f728b64f7d9473e4
parent0c0674dc05d71ab156b7077f4415b78135d7c1cc (diff)
download2023-317e16b1f99036275ac27f850314df5a965526a9.tar.gz
2023-317e16b1f99036275ac27f850314df5a965526a9.tar.bz2
2023-317e16b1f99036275ac27f850314df5a965526a9.zip
thank u ice very cool
Diffstat (limited to '')
-rw-r--r--Nodes/car.tscn1
-rw-r--r--Scripts/Checkpoint.gd13
2 files changed, 4 insertions, 10 deletions
diff --git a/Nodes/car.tscn b/Nodes/car.tscn
index c3eb2a6..a65ae7b 100644
--- a/Nodes/car.tscn
+++ b/Nodes/car.tscn
@@ -10,7 +10,6 @@ size = Vector2(32, 14)
script = ExtResource("1_0e4ux")
[node name="Sprite2D" type="Sprite2D" parent="."]
-visible = false
rotation = 1.5708
texture = ExtResource("2_wteha")
diff --git a/Scripts/Checkpoint.gd b/Scripts/Checkpoint.gd
index 565afef..119419a 100644
--- a/Scripts/Checkpoint.gd
+++ b/Scripts/Checkpoint.gd
@@ -6,14 +6,9 @@ var was_visited = false
func set_was_visited(visited: bool):
was_visited = visited
- if(visited):
-# $Sprite2Dopen.hide()
- $Sprite2Dclosed.show()
- else:
- $Sprite2Dclosed.hide()
-# $Sprite2Dopen.show()
- # TODO change the sprite to indicate the change
-
+ $Sprite2Dclosed.visible = visited
+ $Sprite2Dopen.visible = !visited
+
+
func _on_area_2d_body_entered(body):
- hide()
set_was_visited(true)