Mainly the third map

This commit is contained in:
2025-08-31 12:13:36 +02:00
parent d253df68b5
commit e60c3d7b72
11 changed files with 2159 additions and 148 deletions

View File

@ -4,11 +4,6 @@ var save_path = "user://map_scores.save"
var map_scores = {}
func _on_button_pressed() -> void:
get_tree().change_scene_to_file("res://Game/Menu/main.tscn")
pass # Replace with function body.
func LoadMap1() -> void:
get_tree().change_scene_to_file("res://Game/Maps/map_1.tscn")
pass # Replace with function body.
@ -16,12 +11,17 @@ func LoadMap1() -> void:
func LoadMap2() -> void:
get_tree().change_scene_to_file("res://Game/Maps/map_2.tscn")
pass # Replace with function body.
func LoadMap3() -> void:
get_tree().change_scene_to_file("res://Game/Maps/map_3.tscn")
pass # Replace with function body.
func _ready() -> void:
loadData()
get_node("VBoxContainer/HBoxContainer/first/Button").connect("button_up", LoadMap1)
get_node("VBoxContainer/HBoxContainer/second/Button").connect("button_up", LoadMap2)
get_node("VBoxContainer/HBoxContainer/third/Button").connect("button_up", LoadMap3)
@ -33,10 +33,12 @@ func loadData() -> void:
file.close()
get_node("VBoxContainer/HBoxContainer/first/Label2").text = "Haven't finished yet" if map_scores["Map1"] == 0 else "Scored: " + str(map_scores["Map1"]) + " out of 10"
get_node("VBoxContainer/HBoxContainer/second/Label2").text = "Haven't finished yet" if map_scores["Map2"] == 0 else "Scored: " + str(map_scores["Map2"]) + " out of 10"
get_node("VBoxContainer/HBoxContainer/third/Label2").text = "Haven't finished yet" if map_scores["Map3"] == 0 else "Scored: " + str(map_scores["Map3"]) + " out of 10"
else:
map_scores["Map1"] = 0
map_scores["Map2"] = 0
map_scores["Map3"] = 0
save_scores()
loadData()