Update Level 1.tscn, Level 2.tscn, Level 3.tscn, and 9 more files

This commit is contained in:
Clevertop 2024-08-13 02:32:14 +10:00
parent f470efbe1f
commit 89cfa2882a
12 changed files with 204 additions and 112 deletions

View file

@ -9,6 +9,7 @@ var credits_shown : bool = false
# Called when the node enters the scene tree for the first time.
func _ready():
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
for level_num in GameManager.levels.size():
var new_button : Button = Button.new()
new_button.text = "Level " + str(level_num) + " : " + GameManager.levels[level_num].level_name
@ -31,9 +32,10 @@ func _process(delta):
func pick_level(picked_level:String):
for level in GameManager.levels:
if level.level_name == picked_level:
get_tree().change_scene_to_file(level.level_path)
for level_num in GameManager.levels.size():
if GameManager.levels[level_num].level_name == picked_level:
get_tree().change_scene_to_file(GameManager.levels[level_num].level_path)
GameManager.current_level = level_num
func _on_credits_button_pressed():
credits_shown = !credits_shown