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

View file

@ -0,0 +1,16 @@
[gd_resource type="Resource" script_class="GameRulesResource" load_steps=2 format=3 uid="uid://dxkuoaiws5cc3"]
[ext_resource type="Script" path="res://components/scripts/game_rules.gd" id="1_g4ck5"]
[resource]
script = ExtResource("1_g4ck5")
level_number = 20
level_name = "High Scores"
level_description = "These are the high scores"
bees_available = 5
nectar_required = 9999999
level_par = 2
collector_enabled = false
dancer_enabled = false
director_enabled = false
distractor_enabled = false

View file

@ -20,6 +20,7 @@ config/icon="res://resources/textures/collector_drone.png"
GameState="*res://utility/game_state.gd" GameState="*res://utility/game_state.gd"
Str="*res://utility/utility_strings.gd" Str="*res://utility/utility_strings.gd"
SceneMgr="*res://utility/global_scene_manager.gd" SceneMgr="*res://utility/global_scene_manager.gd"
HighScoreMgr="*res://utility/high_scores.gd"
[display] [display]

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bhw76y620miuj"
path="res://.godot/imported/highscores.png-755bc25dea6a9b7068f83d8847686b1f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/images/highscores.png"
dest_files=["res://.godot/imported/highscores.png-755bc25dea6a9b7068f83d8847686b1f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cvjdxb2cybcow"
path="res://.godot/imported/gravestone.png-5703c884ce4a9f27ef2d69327f18af65.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/textures/gravestone.png"
dest_files=["res://.godot/imported/gravestone.png-5703c884ce4a9f27ef2d69327f18af65.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cm4u74pa1mmwu"
path="res://.godot/imported/honeypot.png-b45f45f16128e6be852a0ded3c6fd106.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://resources/textures/honeypot.png"
dest_files=["res://.godot/imported/honeypot.png-b45f45f16128e6be852a0ded3c6fd106.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View file

@ -1,10 +1,113 @@
[gd_resource type="Theme" load_steps=2 format=3 uid="uid://cpkvret5gi66h"] [gd_resource type="Theme" load_steps=9 format=3 uid="uid://cpkvret5gi66h"]
[ext_resource type="FontFile" uid="uid://beyoaacc7uhy1" path="res://resources/fonts/Kaph-Regular.ttf" id="1_fwiur"] [ext_resource type="FontFile" uid="uid://beyoaacc7uhy1" path="res://resources/fonts/Kaph-Regular.ttf" id="1_fwiur"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lcmkq"]
bg_color = Color(0.996078, 0.85098, 0.498039, 0.776471)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(1, 0.878431, 0.545098, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c0e0a"]
content_margin_left = 20.0
content_margin_top = 20.0
content_margin_right = 20.0
content_margin_bottom = 20.0
bg_color = Color(0.996078, 0.85098, 0.498039, 1)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0.819608, 0.454902, 0.254902, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g31a1"]
content_margin_left = 20.0
content_margin_top = 20.0
content_margin_right = 20.0
content_margin_bottom = 20.0
bg_color = Color(0.996078, 0.85098, 0.498039, 1)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0.819608, 0.454902, 0.254902, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1c0sa"]
bg_color = Color(0.996078, 0.85098, 0.498039, 0.784314)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0.819608, 0.454902, 0.254902, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
shadow_color = Color(0, 0, 0, 0.258824)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_crayb"]
bg_color = Color(0.819608, 0.454902, 0.254902, 1)
border_color = Color(0.819608, 0.454902, 0.254902, 1)
shadow_color = Color(0, 0, 0, 0.258824)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0rei0"]
bg_color = Color(0.996078, 0.85098, 0.498039, 1)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0.819608, 0.454902, 0.254902, 1)
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
shadow_color = Color(0, 0, 0, 0.258824)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_vj6bi"]
content_margin_left = 2.0
content_margin_top = 2.0
content_margin_right = 2.0
content_margin_bottom = 2.0
bg_color = Color(0.819608, 0.454902, 0.254902, 1)
corner_radius_top_left = 6
corner_radius_top_right = 6
corner_radius_bottom_right = 6
corner_radius_bottom_left = 6
corner_detail = 6
[resource] [resource]
default_font = ExtResource("1_fwiur") default_font = ExtResource("1_fwiur")
default_font_size = 12 default_font_size = 12
Button/colors/font_color = Color(0.819608, 0.454902, 0.254902, 1)
Button/colors/font_hover_color = Color(0.819608, 0.454902, 0.254902, 1)
Button/colors/font_pressed_color = Color(1, 0.878431, 0.545098, 1)
Button/constants/h_separation = 5
Button/font_sizes/font_size = 16
Button/styles/hover = SubResource("StyleBoxFlat_lcmkq")
Button/styles/normal = SubResource("StyleBoxFlat_c0e0a")
Button/styles/pressed = SubResource("StyleBoxFlat_g31a1")
Fonts/fonts/large = ExtResource("1_fwiur") Fonts/fonts/large = ExtResource("1_fwiur")
Fonts/fonts/normal = ExtResource("1_fwiur") Fonts/fonts/normal = ExtResource("1_fwiur")
Label/colors/font_shadow_color = Color(0, 0, 0, 0.921569) Label/colors/font_color = Color(0.819608, 0.454902, 0.254902, 1)
Label/colors/font_shadow_color = Color(0.00392157, 0, 0, 0.45098)
Panel/styles/panel = SubResource("StyleBoxFlat_1c0sa")
PopupMenu/colors/font_color = Color(0.819608, 0.454902, 0.254902, 1)
PopupMenu/constants/h_separation = 6
PopupMenu/constants/v_separation = 6
PopupMenu/styles/hover = SubResource("StyleBoxFlat_crayb")
PopupMenu/styles/panel = SubResource("StyleBoxFlat_0rei0")
ProgressBar/styles/fill = SubResource("StyleBoxFlat_vj6bi")

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"] [node name="MarginContainer" type="MarginContainer" parent="LevelSelect/CenterContainer"]
layout_mode = 2 layout_mode = 2
theme_override_constants/margin_top = 100 theme_override_constants/margin_top = 200
[node name="VBoxContainer" type="VBoxContainer" parent="LevelSelect/CenterContainer/MarginContainer"] [node name="VBoxContainer" type="VBoxContainer" parent="LevelSelect/CenterContainer/MarginContainer"]
layout_mode = 2 layout_mode = 2
[node name="MenuButton" type="MenuButton" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"] [node name="MenuButton" type="MenuButton" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(400, 100)
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20
text = "Level Select" text = "Level Select"
@ -221,11 +222,13 @@ popup/item_5/id = 6
[node name="HighScores" type="Button" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"] [node name="HighScores" type="Button" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2 layout_mode = 2
text = "High Scores" text = "High Scores & Credits"
[node name="ExitGame" type="Button" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"] [node name="ExitGame" type="Button" parent="LevelSelect/CenterContainer/MarginContainer/VBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
custom_minimum_size = Vector2(0, 50)
layout_mode = 2 layout_mode = 2
text = "Quit Game" 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(): func on_high_scores_pressed():
## Load the high scores screen ## Load the high scores screen
Log.pr("High scores button pressed") Log.pr("High scores button pressed")
SceneMgr.load_scene("HIGHSCORES")
pass pass
func on_exit_pressed(): func on_exit_pressed():

View file

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

View file

@ -1,10 +1,7 @@
[gd_scene load_steps=3 format=3 uid="uid://cwutwy11pityw"] [gd_scene load_steps=2 format=3 uid="uid://cwutwy11pityw"]
[ext_resource type="Script" path="res://ui/scripts/level_complete_component.gd" id="1_qpygu"] [ext_resource type="Script" path="res://ui/scripts/level_complete_component.gd" id="1_qpygu"]
[sub_resource type="LabelSettings" id="LabelSettings_phhcy"]
font_size = 32
[node name="LevelCompleteComponent" type="Control"] [node name="LevelCompleteComponent" type="Control"]
layout_mode = 3 layout_mode = 3
anchors_preset = 15 anchors_preset = 15
@ -42,24 +39,27 @@ layout_mode = 2
[node name="HappyBees" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"] [node name="HappyBees" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"]
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(0.819608, 0.454902, 0.254902, 1)
theme_override_font_sizes/font_size = 30
text = "The Bees Are Happy!" text = "The Bees Are Happy!"
label_settings = SubResource("LabelSettings_phhcy")
[node name="TimeSpent" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"] [node name="TimeSpent" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Time Spent: " text = "Time Spent: "
[node name="DronesUsed" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"] [node name="DronesUsed" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Drones Used:" text = "Drones Used:"
[node name="TotalPoints" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"] [node name="TotalPoints" type="Label" parent="MarginContainer/CenterContainer/VBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
theme_override_font_sizes/font_size = 18 theme_override_font_sizes/font_size = 24
text = "Total Points: " text = "Total Points: "
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer/VBoxContainer"] [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/CenterContainer/VBoxContainer"]

View file

@ -90,6 +90,7 @@ unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 0 size_flags_vertical = 0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20
text = "00:00:00" text = "00:00:00"
@ -101,11 +102,13 @@ mouse_filter = 2
[node name="Help_Drone_Placement_Cancel" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"] [node name="Help_Drone_Placement_Cancel" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false visible = false
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Right click to cancel placing a drone" text = "Right click to cancel placing a drone"
[node name="Help_Drone_Placement_Dancer" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"] [node name="Help_Drone_Placement_Dancer" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false visible = false
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Place a dancing drone within range of text = "Place a dancing drone within range of
the hive to tempt bees out. Your time the hive to tempt bees out. Your time
starts when you place a dancer drone." starts when you place a dancer drone."
@ -113,6 +116,7 @@ starts when you place a dancer drone."
[node name="Help_Drone_Placement_Collector" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"] [node name="Help_Drone_Placement_Collector" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false visible = false
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Place a collector drone within range text = "Place a collector drone within range
of a flower patch to tell the bees of a flower patch to tell the bees
where they need to go to gather pollen." where they need to go to gather pollen."
@ -120,6 +124,7 @@ where they need to go to gather pollen."
[node name="Help_Drone_Placement_Director" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"] [node name="Help_Drone_Placement_Director" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false visible = false
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Use the Director drones to guide bees text = "Use the Director drones to guide bees
around obstacles. Bees fly in straight(ish) around obstacles. Bees fly in straight(ish)
lines between hive, directors, and collectors." lines between hive, directors, and collectors."
@ -127,6 +132,7 @@ lines between hive, directors, and collectors."
[node name="Help_Drone_Placement_Distractor" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"] [node name="Help_Drone_Placement_Distractor" type="Label" parent="MarginContainer/MarginContainer/HelpTextContainer"]
visible = false visible = false
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Use a distractor drone to try and divert a text = "Use a distractor drone to try and divert a
threats attention away from the bees." threats attention away from the bees."
@ -135,6 +141,7 @@ unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 0 size_flags_horizontal = 0
size_flags_vertical = 8 size_flags_vertical = 8
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Level: 1" text = "Level: 1"
[node name="ParText" type="Label" parent="MarginContainer"] [node name="ParText" type="Label" parent="MarginContainer"]
@ -144,4 +151,5 @@ size_flags_horizontal = 8
size_flags_vertical = 8 size_flags_vertical = 8
tooltip_text = "Par is the number of drones it should take you to complete this level" tooltip_text = "Par is the number of drones it should take you to complete this level"
mouse_filter = 1 mouse_filter = 1
theme_override_colors/font_color = Color(1, 1, 1, 1)
text = "Par: 2" text = "Par: 2"

View file

@ -12,7 +12,7 @@ var gathered_nectar : int = 0 :
return gathered_nectar return gathered_nectar
set(value): set(value):
gathered_nectar = value gathered_nectar = value
if gathered_nectar > required_nectar: if gathered_nectar > required_nectar and !level_complete:
game_win() game_win()
@export var required_nectar : int = 100 @export var required_nectar : int = 100
@ -52,6 +52,7 @@ func game_start():
func game_win(): func game_win():
Log.pr("Game win") Log.pr("Game win")
level_complete = true level_complete = true
HighScoreMgr.add_honey(gathered_nectar)
# get_tree().paused = true # get_tree().paused = true
func game_lose(): func game_lose():

43
utility/high_scores.gd Normal file
View file

@ -0,0 +1,43 @@
class_name HighScores extends Node
@onready var loaded_data = SaveStateResource.new()
func save():
var save_data : SaveStateResource = SaveStateResource.new()
save_data.level_1_score = loaded_data.level_1_score
save_data.level_2_score = loaded_data.level_2_score
save_data.level_3_score = loaded_data.level_3_score
save_data.level_4_score = loaded_data.level_4_score
save_data.level_5_score = loaded_data.level_5_score
save_data.level_6_score = loaded_data.level_6_score
save_data.total_bees_killed = loaded_data.total_bees_killed
save_data.total_honey_collected = loaded_data.total_honey_collected
ResourceSaver.save(save_data, "user://savedata.tres")
func load():
var save_data : SaveStateResource = load("user://savedata.tres")
if save_data:
loaded_data.level_1_score = save_data.level_1_score
loaded_data.level_2_score = save_data.level_2_score
loaded_data.level_3_score = save_data.level_3_score
loaded_data.level_4_score = save_data.level_4_score
loaded_data.level_5_score = save_data.level_5_score
loaded_data.level_6_score = save_data.level_6_score
loaded_data.total_bees_killed = save_data.total_bees_killed
loaded_data.total_honey_collected = save_data.total_honey_collected
func add_honey(honey : int):
loaded_data.total_honey_collected += honey
save()
func debug_save_high_score():
loaded_data.level_1_score = 3000
save()
func debug_output():
Log.pr("High Scores", loaded_data.level_1_score)

View file

@ -0,0 +1,11 @@
class_name SaveStateResource extends Resource
@export var level_1_score : int = 0
@export var level_2_score : int = 0
@export var level_3_score : int = 0
@export var level_4_score : int = 0
@export var level_5_score : int = 0
@export var level_6_score : int = 0
@export var total_bees_killed : int = 0
@export var total_honey_collected : int = 0