aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
authorLibravatar perivesta <>2023-07-08 21:41:51 +0200
committerLibravatar perivesta <>2023-07-08 21:41:51 +0200
commit0d31b1a2bd4658263d957971a3877ef30383eac2 (patch)
tree2dcc4a9d10d2ca3c90c55865799a46414abf3336 /Scripts
parent9d03b489eedeb69b1330e6b627400d853dd7547a (diff)
download2023-0d31b1a2bd4658263d957971a3877ef30383eac2.tar.gz
2023-0d31b1a2bd4658263d957971a3877ef30383eac2.tar.bz2
2023-0d31b1a2bd4658263d957971a3877ef30383eac2.zip
some bug fixes
Diffstat (limited to 'Scripts')
-rw-r--r--Scripts/Checkpoint.gd5
-rw-r--r--Scripts/game.gd4
-rw-r--r--Scripts/scene_control.gd1
3 files changed, 8 insertions, 2 deletions
diff --git a/Scripts/Checkpoint.gd b/Scripts/Checkpoint.gd
index ed10f74..d8c671e 100644
--- a/Scripts/Checkpoint.gd
+++ b/Scripts/Checkpoint.gd
@@ -8,7 +8,12 @@ var was_visited = false
func set_was_visited(visited: bool):
was_visited = visited
+ if(visited):
+ hide()
+ else:
+ show()
# TODO change the sprite to indicate the change
func _on_area_2d_body_entered(body):
+ hide()
set_was_visited(true)
diff --git a/Scripts/game.gd b/Scripts/game.gd
index 42918c5..72a01e3 100644
--- a/Scripts/game.gd
+++ b/Scripts/game.gd
@@ -1,6 +1,6 @@
extends Node2D
-const NUM_LEVELS = 3
+const NUM_LEVELS = 2
# level control
var current_level_id = 0
@@ -54,7 +54,7 @@ func next_level():
current_level_id += 1
if current_level_id >= NUM_LEVELS:
- get_tree().change_scene("res://scenes/levels/MainMenu.tscn")
+ get_tree().change_scene_to_file("res://Nodes/main_menu.tscn")
return
load_scene_by_index(current_level_id)
diff --git a/Scripts/scene_control.gd b/Scripts/scene_control.gd
index 7f0ba5e..f9bc40a 100644
--- a/Scripts/scene_control.gd
+++ b/Scripts/scene_control.gd
@@ -45,6 +45,7 @@ func get_path_next_position(pos):
return path_follow.position
func set_driving(driving: bool):
+ print('control driving: ' , driving)
car.driving = driving
is_driving = driving