Mainly the third map
This commit is contained in:
@ -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()
|
||||
|
@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=14 format=3 uid="uid://cxet2lvdco2ak"]
|
||||
[gd_scene load_steps=19 format=3 uid="uid://cxet2lvdco2ak"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://duhi4pfoa45j1" path="res://Game/Menu/mapselector.gd" id="1_cnef1"]
|
||||
[ext_resource type="Texture2D" uid="uid://bgy114b67j3kg" path="res://Assets/Others/8-bit-graphics-pixels-scene-with-castle.jpg" id="1_jteil"]
|
||||
[ext_resource type="FontFile" uid="uid://bu44ne346ymoe" path="res://Assets/Others/Canterbury.ttf" id="2_2uj2s"]
|
||||
[ext_resource type="Texture2D" uid="uid://cheweipqa125e" path="res://Assets/Maps/map1.png" id="3_2uj2s"]
|
||||
[ext_resource type="Texture2D" uid="uid://dffphf4kn5sk2" path="res://Assets/Maps/map2.png" id="5_mjmwi"]
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_cnef1"]
|
||||
texture = ExtResource("1_jteil")
|
||||
@ -20,6 +21,18 @@ texture = ExtResource("3_2uj2s")
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_cg1t8"]
|
||||
texture = ExtResource("3_2uj2s")
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_losb8"]
|
||||
texture = ExtResource("5_mjmwi")
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_rjq3w"]
|
||||
texture = ExtResource("5_mjmwi")
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_uvrvw"]
|
||||
texture = ExtResource("5_mjmwi")
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_44oc2"]
|
||||
texture = ExtResource("5_mjmwi")
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cnef1"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mjmwi"]
|
||||
@ -139,16 +152,38 @@ text = "2nd Level"
|
||||
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer/second"]
|
||||
custom_minimum_size = Vector2(120, 80)
|
||||
layout_mode = 2
|
||||
theme_override_styles/focus = SubResource("StyleBoxTexture_mjmwi")
|
||||
theme_override_styles/hover = SubResource("StyleBoxTexture_udeaf")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxTexture_5yqcp")
|
||||
theme_override_styles/normal = SubResource("StyleBoxTexture_cg1t8")
|
||||
theme_override_styles/focus = SubResource("StyleBoxTexture_losb8")
|
||||
theme_override_styles/hover = SubResource("StyleBoxTexture_rjq3w")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxTexture_uvrvw")
|
||||
theme_override_styles/normal = SubResource("StyleBoxTexture_44oc2")
|
||||
|
||||
[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer/second"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Score: 10 / "
|
||||
|
||||
[node name="third" type="VBoxContainer" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/third"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "3rd Level"
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer/third"]
|
||||
custom_minimum_size = Vector2(120, 80)
|
||||
layout_mode = 2
|
||||
theme_override_styles/focus = SubResource("StyleBoxTexture_losb8")
|
||||
theme_override_styles/hover = SubResource("StyleBoxTexture_rjq3w")
|
||||
theme_override_styles/pressed = SubResource("StyleBoxTexture_uvrvw")
|
||||
theme_override_styles/normal = SubResource("StyleBoxTexture_44oc2")
|
||||
|
||||
[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer/third"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Score: 10 / "
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 12
|
||||
|
Reference in New Issue
Block a user