aboutsummaryrefslogtreecommitdiffstats
path: root/Scripts
diff options
context:
space:
mode:
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