Level display

This commit is contained in:
MarcEricMartel 2022-10-12 14:15:05 -04:00
parent b93381bbe1
commit 96acedc23c
2 changed files with 24 additions and 5 deletions

View File

@ -225,11 +225,23 @@ margin_right = -17.0
margin_bottom = 26.0 margin_bottom = 26.0
text = "Master Volume" text = "Master Volume"
[node name="Timer" type="Timer" parent="MenuLayer/Start"]
wait_time = 2.0
[node name="Level" type="Label" parent="MenuLayer/Start"] [node name="Level" type="Label" parent="MenuLayer/Start"]
margin_left = 546.0 margin_left = 546.0
margin_top = 478.0 margin_top = 478.0
margin_right = 1414.0 margin_right = 1414.0
margin_bottom = 526.0 margin_bottom = 526.0
theme = SubResource( 8 )
align = 1
[node name="Level" type="Label" parent="."]
margin_left = 546.0
margin_top = 478.0
margin_right = 1414.0
margin_bottom = 526.0
theme = SubResource( 8 )
align = 1 align = 1
[connection signal="pressed" from="MenuLayer/Start/New Game" to="MenuLayer/Start" method="_on_New_Game_pressed"] [connection signal="pressed" from="MenuLayer/Start/New Game" to="MenuLayer/Start" method="_on_New_Game_pressed"]
@ -243,3 +255,4 @@ align = 1
[connection signal="value_changed" from="MenuLayer/Start/Options/MusicSlider" to="MenuLayer/Start/Options" method="_on_MusicSlider_value_changed"] [connection signal="value_changed" from="MenuLayer/Start/Options/MusicSlider" to="MenuLayer/Start/Options" method="_on_MusicSlider_value_changed"]
[connection signal="mouse_exited" from="MenuLayer/Start/Options/MasterVolSlider" to="MenuLayer/Start/Options" method="_on_MasterVolSlider_mouse_exited"] [connection signal="mouse_exited" from="MenuLayer/Start/Options/MasterVolSlider" to="MenuLayer/Start/Options" method="_on_MasterVolSlider_mouse_exited"]
[connection signal="value_changed" from="MenuLayer/Start/Options/MasterVolSlider" to="MenuLayer/Start/Options" method="_on_MasterVolSlider_value_changed"] [connection signal="value_changed" from="MenuLayer/Start/Options/MasterVolSlider" to="MenuLayer/Start/Options" method="_on_MasterVolSlider_value_changed"]
[connection signal="timeout" from="MenuLayer/Start/Timer" to="MenuLayer/Start" method="_on_Timer_timeout"]

View File

@ -5,12 +5,14 @@ onready var NewGame = $"New Game"
onready var QuitGame = $"Quit Game" onready var QuitGame = $"Quit Game"
onready var QuitDesktop = $"Quit to Desktop" onready var QuitDesktop = $"Quit to Desktop"
onready var MMusic = $"MenuMusic" onready var MMusic = $"MenuMusic"
onready var CurrentLevel = $"Level" onready var CurrentLevel = $"../../Level"
onready var CurrLevelMenu = $"Level"
onready var Timer = $Timer
onready var Levels = { onready var Levels = {
"lvl1": "Level 1 - What did the five fingers say to the face? SLAP!", "lvl1": "Level 1 - What did the five fingers say to the face? SLAP!",
"lvl2": "Level 2 - Something in the way...", "lvl2": "Level 2 - Something in the way...",
"lvl3": "Level 3 - But not too straight, maybe from behind.", "lvl3": "Level 3 - But not too straight.",
"lvl4": "Level 4 - ", "lvl4": "Level 4 - ",
"lvl5": "Level 5 - ", "lvl5": "Level 5 - ",
"lvl6": "Level 6 - ", "lvl6": "Level 6 - ",
@ -24,7 +26,8 @@ onready var Levels = {
} }
func _ready(): func _ready():
CurrentLevel.text = Levels[get_tree().get_current_scene().get_name()] CurrLevelMenu.text = Levels[get_tree().get_current_scene().get_name()]
CurrentLevel.text = CurrLevelMenu.text
QuitGame.hide() QuitGame.hide()
QuitDesktop.margin_top -= 44 QuitDesktop.margin_top -= 44
QuitDesktop.margin_bottom -= 44 QuitDesktop.margin_bottom -= 44
@ -38,6 +41,9 @@ func _on_Quit_to_Desktop_Button_pressed():
func _on_New_Game_pressed(): func _on_New_Game_pressed():
get_parent().hide() get_parent().hide()
if !ingame:
CurrentLevel.show()
Timer.start()
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
get_tree().paused = false get_tree().paused = false
ingame = true ingame = true
@ -61,5 +67,5 @@ func openMenu():
func _on_Quit_Game_pressed(): func _on_Quit_Game_pressed():
get_tree().reload_current_scene() get_tree().reload_current_scene()
func _on_Timer_timeout():
CurrentLevel.hide()