difficulty descriptions
This commit is contained in:
parent
dd31a1764f
commit
7b0d520d1f
2 changed files with 75 additions and 20 deletions
|
@ -1,11 +1,24 @@
|
||||||
extends Node
|
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 file: Save.SaveFile = null
|
||||||
var difficulty: int = Game.Difficulty.SPICY
|
var difficulty: int = Game.Difficulty.SPICY
|
||||||
|
|
||||||
onready var face: Sprite = $"%Face"
|
onready var face: Sprite = $"%Face"
|
||||||
onready var chosen_name: Label = $"%ChosenName"
|
onready var chosen_name: Label = $"%ChosenName"
|
||||||
|
onready var enemies: Label = $"%Enemies"
|
||||||
|
onready var lives: Label = $"%Lives"
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
@ -30,6 +43,8 @@ func _set_difficulty(value: int) -> void:
|
||||||
difficulty = posmod(value, 4)
|
difficulty = posmod(value, 4)
|
||||||
file.difficulty = difficulty
|
file.difficulty = difficulty
|
||||||
face.frame = difficulty
|
face.frame = difficulty
|
||||||
|
enemies.text = DESCRIPTIONS[difficulty].enemies
|
||||||
|
lives.text = DESCRIPTIONS[difficulty].lives
|
||||||
|
|
||||||
|
|
||||||
func _difficulty_selected() -> void:
|
func _difficulty_selected() -> void:
|
||||||
|
|
|
@ -73,16 +73,25 @@ anchor_bottom = 1.0
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 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 )
|
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 )
|
material = SubResource( 2 )
|
||||||
margin_left = 16.0
|
margin_left = 16.0
|
||||||
margin_top = 8.0
|
margin_top = 8.0
|
||||||
|
@ -93,7 +102,7 @@ salty
|
||||||
spicy
|
spicy
|
||||||
pungent"
|
pungent"
|
||||||
|
|
||||||
[node name="Sweet" type="TextureButton" parent="DifficultySelect/Panel"]
|
[node name="Sweet" type="TextureButton" parent="DifficultySelect/ButtonsPanel"]
|
||||||
material = SubResource( 3 )
|
material = SubResource( 3 )
|
||||||
margin_left = 8.0
|
margin_left = 8.0
|
||||||
margin_top = 9.0
|
margin_top = 9.0
|
||||||
|
@ -103,7 +112,7 @@ focus_neighbour_top = NodePath("../Pungent")
|
||||||
focus_neighbour_bottom = NodePath("../Salty")
|
focus_neighbour_bottom = NodePath("../Salty")
|
||||||
texture_focused = ExtResource( 6 )
|
texture_focused = ExtResource( 6 )
|
||||||
|
|
||||||
[node name="Salty" type="TextureButton" parent="DifficultySelect/Panel"]
|
[node name="Salty" type="TextureButton" parent="DifficultySelect/ButtonsPanel"]
|
||||||
material = SubResource( 3 )
|
material = SubResource( 3 )
|
||||||
margin_left = 8.0
|
margin_left = 8.0
|
||||||
margin_top = 22.0
|
margin_top = 22.0
|
||||||
|
@ -113,7 +122,7 @@ focus_neighbour_top = NodePath("../Sweet")
|
||||||
focus_neighbour_bottom = NodePath("../Spicy")
|
focus_neighbour_bottom = NodePath("../Spicy")
|
||||||
texture_focused = ExtResource( 6 )
|
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
|
unique_name_in_owner = true
|
||||||
material = SubResource( 3 )
|
material = SubResource( 3 )
|
||||||
margin_left = 8.0
|
margin_left = 8.0
|
||||||
|
@ -124,7 +133,7 @@ focus_neighbour_top = NodePath("../Salty")
|
||||||
focus_neighbour_bottom = NodePath("../Pungent")
|
focus_neighbour_bottom = NodePath("../Pungent")
|
||||||
texture_focused = ExtResource( 6 )
|
texture_focused = ExtResource( 6 )
|
||||||
|
|
||||||
[node name="Pungent" type="TextureButton" parent="DifficultySelect/Panel"]
|
[node name="Pungent" type="TextureButton" parent="DifficultySelect/ButtonsPanel"]
|
||||||
material = SubResource( 3 )
|
material = SubResource( 3 )
|
||||||
margin_left = 8.0
|
margin_left = 8.0
|
||||||
margin_top = 48.0
|
margin_top = 48.0
|
||||||
|
@ -134,6 +143,37 @@ focus_neighbour_top = NodePath("../Spicy")
|
||||||
focus_neighbour_bottom = NodePath("../Sweet")
|
focus_neighbour_bottom = NodePath("../Sweet")
|
||||||
texture_focused = ExtResource( 6 )
|
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"]
|
[node name="SG" type="TextureRect" parent="DifficultySelect"]
|
||||||
margin_left = 176.0
|
margin_left = 176.0
|
||||||
margin_top = 40.0
|
margin_top = 40.0
|
||||||
|
@ -320,12 +360,12 @@ region_rect = Rect2( 0, 0, 16, 24 )
|
||||||
position = Vector2( 0, 4 )
|
position = Vector2( 0, 4 )
|
||||||
shape = SubResource( 6 )
|
shape = SubResource( 6 )
|
||||||
|
|
||||||
[connection signal="focus_entered" from="DifficultySelect/Panel/Sweet" to="." method="_set_difficulty" binds= [ 0 ]]
|
[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Sweet" to="." method="_set_difficulty" binds= [ 0 ]]
|
||||||
[connection signal="pressed" from="DifficultySelect/Panel/Sweet" to="." method="_difficulty_selected"]
|
[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Sweet" to="." method="_difficulty_selected"]
|
||||||
[connection signal="focus_entered" from="DifficultySelect/Panel/Salty" to="." method="_set_difficulty" binds= [ 1 ]]
|
[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Salty" to="." method="_set_difficulty" binds= [ 1 ]]
|
||||||
[connection signal="pressed" from="DifficultySelect/Panel/Salty" to="." method="_difficulty_selected"]
|
[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Salty" to="." method="_difficulty_selected"]
|
||||||
[connection signal="focus_entered" from="DifficultySelect/Panel/Spicy" to="." method="_set_difficulty" binds= [ 2 ]]
|
[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Spicy" to="." method="_set_difficulty" binds= [ 2 ]]
|
||||||
[connection signal="pressed" from="DifficultySelect/Panel/Spicy" to="." method="_difficulty_selected"]
|
[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Spicy" to="." method="_difficulty_selected"]
|
||||||
[connection signal="focus_entered" from="DifficultySelect/Panel/Pungent" to="." method="_set_difficulty" binds= [ 3 ]]
|
[connection signal="focus_entered" from="DifficultySelect/ButtonsPanel/Pungent" to="." method="_set_difficulty" binds= [ 3 ]]
|
||||||
[connection signal="pressed" from="DifficultySelect/Panel/Pungent" to="." method="_difficulty_selected"]
|
[connection signal="pressed" from="DifficultySelect/ButtonsPanel/Pungent" to="." method="_difficulty_selected"]
|
||||||
[connection signal="area_entered" from="NameEntry/Exit" to="." method="_on_Exit_area_entered"]
|
[connection signal="area_entered" from="NameEntry/Exit" to="." method="_on_Exit_area_entered"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue