diff options
Diffstat (limited to 'Scripts')
-rw-r--r-- | Scripts/drawing.gd | 3 | ||||
-rw-r--r-- | Scripts/game.gd | 7 | ||||
-rw-r--r-- | Scripts/scene_control.gd | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/Scripts/drawing.gd b/Scripts/drawing.gd index 61896f9..832c42d 100644 --- a/Scripts/drawing.gd +++ b/Scripts/drawing.gd @@ -23,6 +23,9 @@ func _input(event): if drawing and event is InputEventMouseMotion: line.add_point(event.position) path.curve.add_point(event.position) + if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_RIGHT: + drawing = false + reset() func reset(): diff --git a/Scripts/game.gd b/Scripts/game.gd index 72a01e3..582a4da 100644 --- a/Scripts/game.gd +++ b/Scripts/game.gd @@ -8,10 +8,9 @@ var levels = [] var post_game = false var scenes = [ -# preload("res://Nodes/levels/level1/level1.tscn"), -# preload("res://Nodes/levels/level2/level2.tscn") - preload("res://Nodes/Level_test.tscn"), - preload("res://Nodes/Level_test_2.tscn") + preload("res://Levels/Tut01.tscn"), + preload("res://Levels/Tut02.tscn"), + preload("res://Levels/Level_test_2.tscn") ] # Called when the node enters the scene tree for the first time. diff --git a/Scripts/scene_control.gd b/Scripts/scene_control.gd index ce3332f..73d9273 100644 --- a/Scripts/scene_control.gd +++ b/Scripts/scene_control.gd @@ -8,12 +8,12 @@ class_name SceneControl @onready var checkpoints = $Checkpoints.get_children() @onready var ui = $UI/Control @onready var drawing = $DrawNode +@onready var start = $Start var is_driving = false var current_time = 0.0 var game_control -var start func _ready(): @@ -23,8 +23,8 @@ func _ready(): $UI/Control/PostGameUI/RestartButton.pressed.connect(reset_level) $UI/Control/PostGameUI/NextLevelButton.pressed.connect(next_level) - start = $Start as TextureButton - start.pressed.connect(start_drawing) + var start_button = $Start/Start as TextureButton + start_button.pressed.connect(start_drawing) reset_level() |