From 7ded947ef4bd9b4dc15201fc6c1cb8ab4ed4e80e Mon Sep 17 00:00:00 2001 From: IcECreAm777 <31211782+IcECreAm777@users.noreply.github.com> Date: Sun, 17 Jul 2022 18:16:22 +0200 Subject: prepared every level --- godot/scenes/Game.gd | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'godot/scenes/Game.gd') diff --git a/godot/scenes/Game.gd b/godot/scenes/Game.gd index 9a68659..6d74fd6 100644 --- a/godot/scenes/Game.gd +++ b/godot/scenes/Game.gd @@ -1,11 +1,10 @@ extends Spatial const NUM_LEVELS = 3 -const PAR = [5,8,10] +const PAR = [5,8,15] # level control var current_level_id = 0 -var levels = [] var post_game = false # stroke control @@ -14,7 +13,8 @@ var strokes_per_level = [0,0,0] var scenes = [ preload("res://scenes/levels/level1/level1.tscn"), - preload("res://scenes/levels/level2/level2.tscn") + preload("res://scenes/levels/level2/level2.tscn"), + preload("res://scenes/levels/level3/level3.tscn") ] # Called when the node enters the scene tree for the first time. @@ -83,15 +83,14 @@ func next_level(): post_game = false current_level_id += 1 - current_strokes = 0 - load_scene_by_index(current_level_id) - if current_level_id >= NUM_LEVELS: get_tree().change_scene("res://scenes/levels/MainMenu.tscn") return + load_scene_by_index(current_level_id) + close_scoreboard() $Evaluation.hide() -- cgit