Gameover menu
This commit is contained in:
parent
175bd597c5
commit
b26c4a4be0
7 changed files with 80 additions and 1 deletions
13
metroidvania/Scenes/Menus/GameOverMenu.gd
Normal file
13
metroidvania/Scenes/Menus/GameOverMenu.gd
Normal file
|
@ -0,0 +1,13 @@
|
|||
extends CenterContainer
|
||||
|
||||
|
||||
func _on_QuitButton_pressed():
|
||||
SoundFx.play_fx("Click", 1, -30)
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_LoadButton_pressed():
|
||||
Music.list_stop()
|
||||
SaverLoader.is_loading = true
|
||||
SoundFx.play_fx("Click", 1, -30)
|
||||
get_tree().change_scene("res://Scenes/World/World.tscn")
|
56
metroidvania/Scenes/Menus/GameOverMenu.tscn
Normal file
56
metroidvania/Scenes/Menus/GameOverMenu.tscn
Normal file
|
@ -0,0 +1,56 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://Scenes/UI/DefaultTheme.tres" type="Theme" id=1]
|
||||
[ext_resource path="res://Scenes/Menus/GameOverMenu.gd" type="Script" id=2]
|
||||
|
||||
[node name="GameOverMenu" type="CenterContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
margin_left = 102.0
|
||||
margin_top = 70.0
|
||||
margin_right = 218.0
|
||||
margin_bottom = 109.0
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer"]
|
||||
margin_right = 116.0
|
||||
margin_bottom = 15.0
|
||||
theme = ExtResource( 1 )
|
||||
text = "GAME OVER"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="Control" type="Control" parent="VBoxContainer"]
|
||||
margin_top = 19.0
|
||||
margin_right = 116.0
|
||||
margin_bottom = 19.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
margin_top = 23.0
|
||||
margin_right = 116.0
|
||||
margin_bottom = 39.0
|
||||
rect_min_size = Vector2( 56, 16 )
|
||||
|
||||
[node name="LoadButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_right = 56.0
|
||||
margin_bottom = 16.0
|
||||
rect_min_size = Vector2( 56, 16 )
|
||||
theme = ExtResource( 1 )
|
||||
text = "LAST SAVE"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
margin_left = 60.0
|
||||
margin_right = 116.0
|
||||
margin_bottom = 16.0
|
||||
rect_min_size = Vector2( 56, 16 )
|
||||
theme = ExtResource( 1 )
|
||||
text = "QUIT"
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/LoadButton" to="." method="_on_MainMenuButton_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/LoadButton" to="." method="_on_LoadButton_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/QuitButton" to="." method="_on_QuitButton_pressed"]
|
|
@ -19,5 +19,6 @@ func _on_QuitButton_pressed():
|
|||
get_tree().quit()
|
||||
|
||||
func _process(_delta):
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
var PlayerIsAlive = get_tree().get_nodes_in_group("Player").size() > 0
|
||||
if Input.is_action_just_pressed("pause") and PlayerIsAlive:
|
||||
self.paused = !paused
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue