Add high scores level with specific settings, new resources for images and textures, update project configuration to include HighScoreMgr, and define style boxes for game theme.

This commit is contained in:
Dan 2024-05-11 13:53:04 +01:00
parent 3eaa959910
commit 115b4b0a69
22 changed files with 821 additions and 12 deletions

495
scenes/high_scores.tscn Normal file
View file

@ -0,0 +1,495 @@
[gd_scene load_steps=22 format=3 uid="uid://8k8c321l2tqn"]
[ext_resource type="Script" path="res://scenes/scripts/high_scores.gd" id="1_b6h24"]
[ext_resource type="PackedScene" uid="uid://dn6aa6f2f4g4i" path="res://components/RulesComponent.tscn" id="2_0nt60"]
[ext_resource type="Resource" uid="uid://dxkuoaiws5cc3" path="res://levels/rules/high_scores.tres" id="3_j02f5"]
[ext_resource type="PackedScene" uid="uid://d1uawawum16b0" path="res://scenes/elements/background.tscn" id="4_avnkq"]
[ext_resource type="PackedScene" uid="uid://dwuc6byusf1r3" path="res://scenes/decor/bush.tscn" id="5_0bo18"]
[ext_resource type="PackedScene" uid="uid://dj51rgpihnhi" path="res://scenes/decor/naked_tree.tscn" id="6_4e28x"]
[ext_resource type="PackedScene" uid="uid://d3mas42mbgec1" path="res://scenes/decor/tree.tscn" id="7_v0qqa"]
[ext_resource type="PackedScene" uid="uid://eiyribk1ijcu" path="res://scenes/decor/mushroom.tscn" id="8_fjao7"]
[ext_resource type="PackedScene" uid="uid://bme541qdw7nai" path="res://entities/Flowers.tscn" id="9_vqajv"]
[ext_resource type="Texture2D" uid="uid://cvjdxb2cybcow" path="res://resources/textures/gravestone.png" id="9_x7ooo"]
[ext_resource type="PackedScene" uid="uid://dyu4mucawjlu6" path="res://entities/Beehive.tscn" id="10_6aukt"]
[ext_resource type="PackedScene" uid="uid://ddf2mkkw1trkj" path="res://scenes/elements/bee_spawner.tscn" id="11_2vjev"]
[ext_resource type="PackedScene" uid="uid://b7eeptlk47ymd" path="res://ui/UiComponent.tscn" id="12_c13u3"]
[ext_resource type="PackedScene" uid="uid://ct3c16xm33r2a" path="res://scenes/elements/drone_manager.tscn" id="13_vehjd"]
[ext_resource type="PackedScene" uid="uid://cx7cunaspu08a" path="res://entities/DancerDrone.tscn" id="14_j78b6"]
[ext_resource type="PackedScene" uid="uid://dqdi1tpoid80c" path="res://entities/CollectorDrone.tscn" id="15_mjeko"]
[ext_resource type="PackedScene" uid="uid://cwutwy11pityw" path="res://ui/LevelCompleteComponent.tscn" id="16_kv4mb"]
[ext_resource type="Texture2D" uid="uid://bhw76y620miuj" path="res://resources/images/highscores.png" id="18_3tnes"]
[ext_resource type="Texture2D" uid="uid://cm4u74pa1mmwu" path="res://resources/textures/honeypot.png" id="19_au33w"]
[ext_resource type="Texture2D" uid="uid://dfsiavjapcxkk" path="res://resources/textures/flower_1.png" id="20_04eck"]
[ext_resource type="Texture2D" uid="uid://d3305m7gu47h2" path="res://resources/textures/flower_2.png" id="21_bmgsg"]
[node name="HighScores" type="Node2D"]
script = ExtResource("1_b6h24")
[node name="RulesComponent" parent="." instance=ExtResource("2_0nt60")]
unique_name_in_owner = true
game_rules = ExtResource("3_j02f5")
[node name="Grass" parent="." instance=ExtResource("4_avnkq")]
[node name="LevelDecor" type="Node" parent="."]
[node name="BushGroup" type="Node2D" parent="LevelDecor"]
position = Vector2(37, -6)
[node name="Bush" parent="LevelDecor/BushGroup" instance=ExtResource("5_0bo18")]
position = Vector2(1110, 28)
scale = Vector2(0.25, 0.25)
[node name="Bush3" parent="LevelDecor/BushGroup" instance=ExtResource("5_0bo18")]
visible = false
position = Vector2(1272, 123)
scale = Vector2(0.25, 0.25)
[node name="Bush2" parent="LevelDecor/BushGroup" instance=ExtResource("5_0bo18")]
position = Vector2(1214, 47)
rotation = 0.60912
scale = Vector2(0.4, 0.4)
[node name="BushGroup3" type="Node2D" parent="LevelDecor"]
position = Vector2(267, 589)
scale = Vector2(0.75, 0.75)
[node name="Bush" parent="LevelDecor/BushGroup3" instance=ExtResource("5_0bo18")]
visible = false
position = Vector2(1110, 28)
scale = Vector2(0.25, 0.25)
[node name="Bush3" parent="LevelDecor/BushGroup3" instance=ExtResource("5_0bo18")]
visible = false
position = Vector2(1272, 123)
scale = Vector2(0.25, 0.25)
[node name="Bush2" parent="LevelDecor/BushGroup3" instance=ExtResource("5_0bo18")]
position = Vector2(1214, 47)
rotation = 0.60912
scale = Vector2(0.4, 0.4)
[node name="BushGroup2" type="Node2D" parent="LevelDecor"]
position = Vector2(-571, 1315)
rotation = 5.29882
[node name="Bush" parent="LevelDecor/BushGroup2" instance=ExtResource("5_0bo18")]
position = Vector2(1110, 28)
scale = Vector2(0.25, 0.25)
[node name="Bush3" parent="LevelDecor/BushGroup2" instance=ExtResource("5_0bo18")]
visible = false
position = Vector2(1272, 123)
scale = Vector2(0.25, 0.25)
[node name="Bush2" parent="LevelDecor/BushGroup2" instance=ExtResource("5_0bo18")]
position = Vector2(1214, 47)
rotation = 0.60912
scale = Vector2(0.4, 0.4)
[node name="NakedTree" parent="LevelDecor" instance=ExtResource("6_4e28x")]
position = Vector2(3, 244)
scale = Vector2(0.6, 0.6)
[node name="Tree" parent="LevelDecor" instance=ExtResource("7_v0qqa")]
position = Vector2(135, 88)
scale = Vector2(0.6, 0.6)
[node name="Tree2" parent="LevelDecor" instance=ExtResource("7_v0qqa")]
visible = false
position = Vector2(64, 473)
rotation = -0.42237
scale = Vector2(0.4, 0.4)
[node name="Mushrooms" type="Node2D" parent="LevelDecor"]
position = Vector2(-19, 253)
[node name="Mushroom" parent="LevelDecor/Mushrooms" instance=ExtResource("8_fjao7")]
position = Vector2(232, 250)
scale = Vector2(0.5, 0.5)
[node name="Mushroom2" parent="LevelDecor/Mushrooms" instance=ExtResource("8_fjao7")]
position = Vector2(252, 289)
rotation = 1.13446
scale = Vector2(0.3, 0.3)
[node name="Mushroom3" parent="LevelDecor/Mushrooms" instance=ExtResource("8_fjao7")]
position = Vector2(260, 225)
rotation = 1.13446
scale = Vector2(0.3, 0.3)
[node name="Gravestone" type="Sprite2D" parent="LevelDecor"]
position = Vector2(1069, 498)
scale = Vector2(0.5, 0.5)
texture = ExtResource("9_x7ooo")
[node name="Shadow" type="Sprite2D" parent="LevelDecor/Gravestone"]
modulate = Color(0, 0, 0, 0.0784314)
show_behind_parent = true
position = Vector2(2, 98)
scale = Vector2(1, 0.4)
texture = ExtResource("9_x7ooo")
[node name="Mushrooms2" type="Node2D" parent="LevelDecor"]
position = Vector2(1147, 1023)
rotation = 3.70359
[node name="Mushroom" parent="LevelDecor/Mushrooms2" instance=ExtResource("8_fjao7")]
position = Vector2(232, 250)
scale = Vector2(0.5, 0.5)
[node name="Mushroom2" parent="LevelDecor/Mushrooms2" instance=ExtResource("8_fjao7")]
visible = false
position = Vector2(252, 289)
rotation = 1.13446
scale = Vector2(0.3, 0.3)
[node name="Mushroom3" parent="LevelDecor/Mushrooms2" instance=ExtResource("8_fjao7")]
position = Vector2(260, 225)
rotation = 1.13446
scale = Vector2(0.3, 0.3)
[node name="Flower1" type="Sprite2D" parent="LevelDecor"]
position = Vector2(608, 269)
scale = Vector2(0.4, 0.4)
texture = ExtResource("20_04eck")
[node name="Flower2" type="Sprite2D" parent="LevelDecor"]
position = Vector2(640, 241)
scale = Vector2(0.4, 0.4)
texture = ExtResource("21_bmgsg")
[node name="Flower3" type="Sprite2D" parent="LevelDecor"]
position = Vector2(676, 277)
scale = Vector2(0.5, 0.5)
texture = ExtResource("20_04eck")
[node name="Flowers" parent="." instance=ExtResource("9_vqajv")]
unique_name_in_owner = true
position = Vector2(1115, 223)
[node name="Beehive" parent="." groups=["beehive"] instance=ExtResource("10_6aukt")]
unique_name_in_owner = true
position = Vector2(281, 176)
[node name="BeeSpawner" parent="." instance=ExtResource("11_2vjev")]
unique_name_in_owner = true
[node name="UiComponent" parent="." instance=ExtResource("12_c13u3")]
unique_name_in_owner = true
visible = false
z_index = 20
offset_right = 1280.0
offset_bottom = 720.0
[node name="DroneManager" parent="." instance=ExtResource("13_vehjd")]
unique_name_in_owner = true
[node name="DancerDrone" parent="DroneManager/SpawnedDrones" index="0" instance=ExtResource("14_j78b6")]
position = Vector2(316, 231)
[node name="CollectorDrone" parent="DroneManager/SpawnedDrones" index="1" instance=ExtResource("15_mjeko")]
position = Vector2(1110, 202)
[node name="Control" parent="DroneManager" index="1"]
visible = false
[node name="LevelCompleteComponent" parent="." instance=ExtResource("16_kv4mb")]
visible = false
z_index = 999
offset_right = 1280.0
offset_bottom = 720.0
[node name="Highscores" type="Sprite2D" parent="."]
position = Vector2(693, 148)
scale = Vector2(0.5, 0.5)
texture = ExtResource("18_3tnes")
[node name="HighScores" type="Control" parent="."]
z_index = 90
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="CenterContainer" type="CenterContainer" parent="HighScores"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -10.5
offset_right = 1229.5
offset_bottom = 680.0
grow_horizontal = 2
grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="HighScores/CenterContainer"]
layout_mode = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 150
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="GridContainer" type="GridContainer" parent="HighScores/CenterContainer/MarginContainer"]
layout_mode = 2
columns = 3
[node name="LevelScoreContainer1" type="Panel" parent="HighScores/CenterContainer/MarginContainer/GridContainer"]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer1"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer1/MarginContainer"]
layout_mode = 2
[node name="LevelOneLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer1/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Level One"
horizontal_alignment = 1
[node name="LevelOneScoreLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer1/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "123121"
horizontal_alignment = 1
[node name="LevelScoreContainer2" type="Panel" parent="HighScores/CenterContainer/MarginContainer/GridContainer"]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer2"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer2/MarginContainer"]
layout_mode = 2
[node name="LevelTwoLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer2/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Level Two"
horizontal_alignment = 1
[node name="LevelTwoScoreLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer2/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "123121"
horizontal_alignment = 1
[node name="LevelScoreContainer3" type="Panel" parent="HighScores/CenterContainer/MarginContainer/GridContainer"]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer3"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer3/MarginContainer"]
layout_mode = 2
[node name="LevelThreeLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer3/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Level Three"
horizontal_alignment = 1
[node name="LevelThreeScoreLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer3/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "123121"
horizontal_alignment = 1
[node name="LevelScoreContainer4" type="Panel" parent="HighScores/CenterContainer/MarginContainer/GridContainer"]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer4"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer4/MarginContainer"]
layout_mode = 2
[node name="LevelFourLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer4/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Level Four"
horizontal_alignment = 1
[node name="LevelFourScoreLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer4/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "123121"
horizontal_alignment = 1
[node name="LevelScoreContainer5" type="Panel" parent="HighScores/CenterContainer/MarginContainer/GridContainer"]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer5"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer5/MarginContainer"]
layout_mode = 2
[node name="LevelFiveLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer5/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Level Five"
horizontal_alignment = 1
[node name="LevelFiveScoreLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer5/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "123121"
horizontal_alignment = 1
[node name="LevelScoreContainer6" type="Panel" parent="HighScores/CenterContainer/MarginContainer/GridContainer"]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer6"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer6/MarginContainer"]
layout_mode = 2
[node name="LevelSixLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer6/MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Level Six"
horizontal_alignment = 1
[node name="LevelSixScoreLabel" type="Label" parent="HighScores/CenterContainer/MarginContainer/GridContainer/LevelScoreContainer6/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "123121"
horizontal_alignment = 1
[node name="Credits" type="Label" parent="HighScores"]
layout_mode = 0
offset_top = 590.0
offset_right = 1280.0
offset_bottom = 695.0
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Design, art, code and music by Dan \"Ritual\" Baker - Ritual.sh / HappyLittleRobots on Itch.io
With special thanks to:
My Wife & Kids, Lu, and the Week Sauce Discord server
Kaph font by GBbot on Itch.io, mouse cursors by kenney.nl"
horizontal_alignment = 1
[node name="BeeDeathLabel" type="Label" parent="HighScores"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 1036.0
offset_top = 450.0
offset_right = 1126.0
offset_bottom = 474.0
rotation = 0.331613
tooltip_text = "You Monster"
mouse_filter = 1
theme_override_colors/font_color = Color(0.482353, 0.513726, 0.509804, 1)
theme_override_colors/font_shadow_color = Color(0.156863, 0.156863, 0.188235, 1)
theme_override_colors/font_outline_color = Color(0.372549, 0.372549, 0.431373, 1)
theme_override_constants/shadow_offset_x = -1
theme_override_constants/shadow_offset_y = -1
theme_override_constants/outline_size = 1
theme_override_font_sizes/font_size = 20
text = "999"
horizontal_alignment = 1
[node name="HoneyCountLabel" type="Label" parent="HighScores"]
unique_name_in_owner = true
custom_minimum_size = Vector2(60, 0)
layout_mode = 0
offset_left = 98.0
offset_top = 602.0
offset_right = 158.0
offset_bottom = 617.0
rotation = -0.0349066
tooltip_text = "Total honey collected"
mouse_filter = 1
theme_override_colors/font_color = Color(0.988235, 0.772549, 0.223529, 1)
theme_override_colors/font_shadow_color = Color(0.0745098, 0.00392157, 0.00784314, 1)
text = "123 "
horizontal_alignment = 1
[node name="MainMenuButton" type="Button" parent="HighScores"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 15.0
offset_top = 645.0
offset_right = 215.0
offset_bottom = 705.0
text = "Main Menu"
[node name="Honeypot" type="Sprite2D" parent="."]
position = Vector2(128, 572)
rotation = -0.0349066
scale = Vector2(0.25, 0.25)
texture = ExtResource("19_au33w")
[node name="Shadow" type="Sprite2D" parent="Honeypot"]
modulate = Color(0, 0, 0, 0.0784314)
show_behind_parent = true
position = Vector2(-1.86554, 168.037)
scale = Vector2(1, 0.3)
texture = ExtResource("19_au33w")
[editable path="DroneManager"]

View file

@ -192,13 +192,14 @@ grow_vertical = 2
[node name="MarginContainer" type="MarginContainer" parent="LevelSelect/CenterContainer"]
layout_mode = 2
theme_override_constants/margin_top = 100
theme_override_constants/margin_top = 200
[node name="VBoxContainer" type="VBoxContainer" parent="LevelSelect/CenterContainer/MarginContainer"]
layout_mode = 2
[node name="MenuButton" type="MenuButton" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(400, 100)
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Level Select"
@ -221,11 +222,13 @@ popup/item_5/id = 6
[node name="HighScores" type="Button" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
text = "High Scores"
text = "High Scores & Credits"
[node name="ExitGame" type="Button" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2
text = "Quit Game"

View file

@ -0,0 +1,19 @@
extends Level
class_name HighScoresScreen
func _ready():
update_game_state()
%BeeDeathLabel.text = Str.format_number(HighScoreMgr.loaded_data.total_bees_killed)
%HoneyCountLabel.text = Str.format_number(HighScoreMgr.loaded_data.total_honey_collected)
%LevelOneScoreLabel.text = Str.format_number(HighScoreMgr.loaded_data.level_1_score)
%LevelTwoScoreLabel.text = Str.format_number(HighScoreMgr.loaded_data.level_2_score)
%LevelThreeScoreLabel.text = Str.format_number(HighScoreMgr.loaded_data.level_3_score)
%LevelFourScoreLabel.text = Str.format_number(HighScoreMgr.loaded_data.level_4_score)
%LevelFiveScoreLabel.text = Str.format_number(HighScoreMgr.loaded_data.level_5_score)
%LevelSixScoreLabel.text = Str.format_number(HighScoreMgr.loaded_data.level_6_score)
%MainMenuButton.connect("pressed", Callable(self, "on_main_menu_button_pressed"))
func on_main_menu_button_pressed():
SceneMgr.load_scene("MAINMENU")

View file

@ -39,6 +39,7 @@ func _on_item_menu_pressed(id):
func on_high_scores_pressed():
## Load the high scores screen
Log.pr("High scores button pressed")
SceneMgr.load_scene("HIGHSCORES")
pass
func on_exit_pressed():

View file

@ -3,7 +3,7 @@ class_name SceneManager
const SCENES : Dictionary = {
"MAINMENU" : "res://scenes/main_menu.tscn",
"HIGHSCORES" : "res://scenes/highscores.tscn",
"HIGHSCORES" : "res://scenes/high_scores.tscn",
"LEVEL1" : "res://levels/level_1.tscn",
"LEVEL2" : "res://levels/level_2.tscn",
"LEVEL3" : "res://levels/level_3.tscn",
@ -15,6 +15,12 @@ const SCENES : Dictionary = {
var loading_scene_res : Resource = null
func _ready():
## LOAD GAME DATA
HighScoreMgr.load()
HighScoreMgr.debug_output()
# HighScoreMgr.debug_save_high_score()
Log.pr("SceneManager is ready.")
SceneMgr.connect("change_scene", Callable(self, "_on_change_scene"))
$TransitionScene.connect("transitioned", Callable(self, "_on_transition_scene_transitioned"))