From 7b0d520d1f3a247860a2150688bbbddd928c8b39 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Fri, 21 Jul 2023 21:19:18 -0400 Subject: [PATCH] difficulty descriptions --- menus/file_create.gd | 15 ++++++++ menus/file_create.tscn | 80 +++++++++++++++++++++++++++++++----------- 2 files changed, 75 insertions(+), 20 deletions(-) diff --git a/menus/file_create.gd b/menus/file_create.gd index 6a20dd9..91829ae 100644 --- a/menus/file_create.gd +++ b/menus/file_create.gd @@ -1,11 +1,24 @@ extends Node +const DESCRIPTIONS := [ + # sweet mode + {"enemies": "*slower enemies", "lives": "*unlimited lives"}, + # salty mode + {"enemies": "*normal enemies", "lives": "*unlimited lives"}, + # spicy mode + {"enemies": "*normal enemies", "lives": "*limited lives"}, + # pungent mode + {"enemies": "*faster enemies", "lives": "*limited lives"}, +] + var file: Save.SaveFile = null var difficulty: int = Game.Difficulty.SPICY onready var face: Sprite = $"%Face" onready var chosen_name: Label = $"%ChosenName" +onready var enemies: Label = $"%Enemies" +onready var lives: Label = $"%Lives" func _ready() -> void: @@ -30,6 +43,8 @@ func _set_difficulty(value: int) -> void: difficulty = posmod(value, 4) file.difficulty = difficulty face.frame = difficulty + enemies.text = DESCRIPTIONS[difficulty].enemies + lives.text = DESCRIPTIONS[difficulty].lives func _difficulty_selected() -> void: diff --git a/menus/file_create.tscn b/menus/file_create.tscn index d8d1ad1..5f6e441 100644 --- a/menus/file_create.tscn +++ b/menus/file_create.tscn @@ -73,16 +73,25 @@ anchor_bottom = 1.0 unique_name_in_owner = true anchor_right = 1.0 anchor_bottom = 1.0 - -[node name="Panel" type="Panel" parent="DifficultySelect"] -material = SubResource( 2 ) -margin_left = 16.0 -margin_top = 32.0 -margin_right = 88.0 -margin_bottom = 96.0 theme = ExtResource( 2 ) -[node name="Body" type="Label" parent="DifficultySelect/Panel"] +[node name="Label" type="Label" parent="DifficultySelect"] +material = ExtResource( 8 ) +margin_left = 8.0 +margin_top = 40.0 +margin_right = 134.0 +margin_bottom = 54.0 +text = "Select Difficulty:" + +[node name="ButtonsPanel" type="Panel" parent="DifficultySelect"] +material = SubResource( 2 ) +margin_left = 16.0 +margin_top = 64.0 +margin_right = 88.0 +margin_bottom = 128.0 +theme = ExtResource( 2 ) + +[node name="Body" type="Label" parent="DifficultySelect/ButtonsPanel"] material = SubResource( 2 ) margin_left = 16.0 margin_top = 8.0 @@ -93,7 +102,7 @@ salty spicy pungent" -[node name="Sweet" type="TextureButton" parent="DifficultySelect/Panel"] +[node name="Sweet" type="TextureButton" parent="DifficultySelect/ButtonsPanel"] material = SubResource( 3 ) margin_left = 8.0 margin_top = 9.0 @@ -103,7 +112,7 @@ focus_neighbour_top = NodePath("../Pungent") focus_neighbour_bottom = NodePath("../Salty") texture_focused = ExtResource( 6 ) -[node name="Salty" type="TextureButton" parent="DifficultySelect/Panel"] +[node name="Salty" type="TextureButton" parent="DifficultySelect/ButtonsPanel"] material = SubResource( 3 ) margin_left = 8.0 margin_top = 22.0 @@ -113,7 +122,7 @@ focus_neighbour_top = NodePath("../Sweet") focus_neighbour_bottom = NodePath("../Spicy") texture_focused = ExtResource( 6 ) -[node name="Spicy" type="TextureButton" parent="DifficultySelect/Panel"] +[node name="Spicy" type="TextureButton" parent="DifficultySelect/ButtonsPanel"] unique_name_in_owner = true material = SubResource( 3 ) margin_left = 8.0 @@ -124,7 +133,7 @@ focus_neighbour_top = NodePath("../Salty") focus_neighbour_bottom = NodePath("../Pungent") texture_focused = ExtResource( 6 ) -[node name="Pungent" type="TextureButton" parent="DifficultySelect/Panel"] +[node name="Pungent" type="TextureButton" parent="DifficultySelect/ButtonsPanel"] material = SubResource( 3 ) margin_left = 8.0 margin_top = 48.0 @@ -134,6 +143,37 @@ focus_neighbour_top = NodePath("../Spicy") focus_neighbour_bottom = NodePath("../Sweet") texture_focused = ExtResource( 6 ) +[node name="DescriptionPanel" type="Panel" parent="DifficultySelect"] +material = SubResource( 2 ) +margin_left = 16.0 +margin_top = 136.0 +margin_right = 144.0 +margin_bottom = 176.0 +theme = ExtResource( 2 ) + +[node name="Enemies" type="Label" parent="DifficultySelect/DescriptionPanel"] +unique_name_in_owner = true +material = SubResource( 2 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 8.0 +margin_top = 8.0 +margin_right = -8.0 +margin_bottom = -22.0 +text = "*normal enemies" +autowrap = true + +[node name="Lives" type="Label" parent="DifficultySelect/DescriptionPanel"] +unique_name_in_owner = true +material = SubResource( 2 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 8.0 +margin_top = 22.0 +margin_bottom = -8.0 +text = "*limited lives" +autowrap = true + [node name="SG" type="TextureRect" parent="DifficultySelect"] margin_left = 176.0 margin_top = 40.0 @@ -320,12 +360,12 @@ region_rect = Rect2( 0, 0, 16, 24 ) position = Vector2( 0, 4 ) shape = SubResource( 6 ) -[connection signal="focus_entered" from="DifficultySelect/Panel/Sweet" to="." method="_set_difficulty" binds= [ 0 ]] -[connection signal="pressed" from="DifficultySelect/Panel/Sweet" to="." method="_difficulty_selected"] -[connection signal="focus_entered" from="DifficultySelect/Panel/Salty" to="." method="_set_difficulty" binds= [ 1 ]] -[connection signal="pressed" from="DifficultySelect/Panel/Salty" to="." method="_difficulty_selected"] -[connection signal="focus_entered" from="DifficultySelect/Panel/Spicy" to="." method="_set_difficulty" binds= [ 2 ]] -[connection signal="pressed" from="DifficultySelect/Panel/Spicy" to="." method="_difficulty_selected"] -[connection signal="focus_entered" from="DifficultySelect/Panel/Pungent" to="." method="_set_difficulty" binds= [ 3 ]] -[connection signal="pressed" from="DifficultySelect/Panel/Pungent" to="." method="_difficulty_selected"] +[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Sweet" to="." method="_set_difficulty" binds= [ 0 ]] +[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Sweet" to="." method="_difficulty_selected"] +[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Salty" to="." method="_set_difficulty" binds= [ 1 ]] +[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Salty" to="." method="_difficulty_selected"] +[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Spicy" to="." method="_set_difficulty" binds= [ 2 ]] +[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Spicy" to="." method="_difficulty_selected"] +[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Pungent" to="." method="_set_difficulty" binds= [ 3 ]] +[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Pungent" to="." method="_difficulty_selected"] [connection signal="area_entered" from="NameEntry/Exit" to="." method="_on_Exit_area_entered"]