Added pause capability to all levels, added music to Level 5, added a simple chasing AI to the glowing ghosts, and optimized the Main Menu scene
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
extends Node
|
||||
extends CanvasLayer
|
||||
|
||||
signal complete(option)
|
||||
|
||||
@@ -9,12 +9,12 @@ func _on_new_game_button_pressed() -> void:
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
emit_signal('complete', 'quit')
|
||||
get_tree().quit()
|
||||
return
|
||||
|
||||
|
||||
func _on_continue_button_mouse_entered() -> void:
|
||||
if not $'Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer/Continue Button'.disabled:
|
||||
if not $'Menu/Menu Elements/Menu Options/Continue/Continue Button'.disabled:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
@@ -1,16 +1,16 @@
|
||||
[gd_scene load_steps=18 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Settings_Button_Normal.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Continue_Button_Hover.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Credits_Button_Normal.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Continue_Button_Normal.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/New_Game_Button_Normal.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Continue_Button_Disabled.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/New_Game_Button_Hover.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Quit_Button_Normal.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Credits_Button_Hover.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Settings_Button_Hover.png" type="Texture" id=10]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Quit_Button_Hover.png" type="Texture" id=11]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Settings_Button_Normal.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Continue_Button_Hover.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Credits_Button_Normal.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Continue_Button_Normal.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/New_Game_Button_Normal.png" type="Texture" id=5]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Continue_Button_Disabled.png" type="Texture" id=6]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/New_Game_Button_Hover.png" type="Texture" id=7]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Normal.png" type="Texture" id=8]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Credits_Button_Hover.png" type="Texture" id=9]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Settings_Button_Hover.png" type="Texture" id=10]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Hover.png" type="Texture" id=11]
|
||||
[ext_resource path="res://Sprites/Menus/Main Menu/Main_Menu_Background.png" type="Texture" id=12]
|
||||
[ext_resource path="res://Resources/Ash.tres" type="DynamicFontData" id=13]
|
||||
[ext_resource path="res://GUI/Main Menu.gd" type="Script" id=14]
|
||||
@@ -23,14 +23,16 @@ use_mipmaps = true
|
||||
extra_spacing_bottom = 15
|
||||
font_data = ExtResource( 13 )
|
||||
|
||||
[node name="Main Menu" type="Node"]
|
||||
[node name="Main Menu" type="CanvasLayer"]
|
||||
script = ExtResource( 14 )
|
||||
|
||||
[node name="Background" type="Sprite" parent="."]
|
||||
[node name="Background" type="TextureRect" parent="."]
|
||||
texture = ExtResource( 12 )
|
||||
centered = false
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Menu Items" type="MarginContainer" parent="."]
|
||||
[node name="Menu" type="CenterContainer" parent="."]
|
||||
margin_left = 10.0
|
||||
margin_top = 10.0
|
||||
margin_right = 310.0
|
||||
@@ -40,86 +42,84 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Menu Items"]
|
||||
margin_right = 300.0
|
||||
margin_bottom = 160.0
|
||||
[node name="Menu Elements" type="VBoxContainer" parent="Menu"]
|
||||
margin_left = 42.0
|
||||
margin_top = 11.0
|
||||
margin_right = 257.0
|
||||
margin_bottom = 149.0
|
||||
alignment = 2
|
||||
|
||||
[node name="Title" type="Label" parent="Menu Items/VBoxContainer"]
|
||||
margin_top = 23.0
|
||||
margin_right = 300.0
|
||||
margin_bottom = 62.0
|
||||
[node name="Title" type="Label" parent="Menu/Menu Elements"]
|
||||
margin_right = 215.0
|
||||
margin_bottom = 40.0
|
||||
rect_min_size = Vector2( 0, 40 )
|
||||
custom_fonts/font = SubResource( 1 )
|
||||
text = "Embodiment"
|
||||
align = 1
|
||||
valign = 1
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="Menu Items/VBoxContainer"]
|
||||
margin_top = 66.0
|
||||
margin_right = 300.0
|
||||
margin_bottom = 160.0
|
||||
[node name="Menu Options" type="VBoxContainer" parent="Menu/Menu Elements"]
|
||||
margin_top = 44.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 138.0
|
||||
|
||||
[node name="Menu Options" type="VBoxContainer" parent="Menu Items/VBoxContainer/CenterContainer"]
|
||||
margin_left = 108.0
|
||||
margin_right = 191.0
|
||||
margin_bottom = 94.0
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options"]
|
||||
margin_right = 83.0
|
||||
[node name="Continue" type="CenterContainer" parent="Menu/Menu Elements/Menu Options"]
|
||||
margin_right = 215.0
|
||||
margin_bottom = 15.0
|
||||
|
||||
[node name="Continue Button" type="TextureButton" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer"]
|
||||
margin_left = 7.0
|
||||
margin_right = 75.0
|
||||
[node name="Continue Button" type="TextureButton" parent="Menu/Menu Elements/Menu Options/Continue"]
|
||||
margin_left = 73.0
|
||||
margin_right = 141.0
|
||||
margin_bottom = 15.0
|
||||
disabled = true
|
||||
texture_normal = ExtResource( 4 )
|
||||
texture_hover = ExtResource( 2 )
|
||||
texture_disabled = ExtResource( 6 )
|
||||
|
||||
[node name="CenterContainer2" type="CenterContainer" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options"]
|
||||
[node name="New Game" type="CenterContainer" parent="Menu/Menu Elements/Menu Options"]
|
||||
margin_top = 19.0
|
||||
margin_right = 83.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 33.0
|
||||
|
||||
[node name="New Game Button" type="TextureButton" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer2"]
|
||||
margin_right = 83.0
|
||||
[node name="New Game Button" type="TextureButton" parent="Menu/Menu Elements/Menu Options/New Game"]
|
||||
margin_left = 66.0
|
||||
margin_right = 149.0
|
||||
margin_bottom = 14.0
|
||||
texture_normal = ExtResource( 5 )
|
||||
texture_hover = ExtResource( 7 )
|
||||
|
||||
[node name="CenterContainer3" type="CenterContainer" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options"]
|
||||
[node name="Settings" type="CenterContainer" parent="Menu/Menu Elements/Menu Options"]
|
||||
margin_top = 37.0
|
||||
margin_right = 83.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 56.0
|
||||
|
||||
[node name="Settings Button" type="TextureButton" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer3"]
|
||||
margin_left = 11.0
|
||||
margin_right = 72.0
|
||||
[node name="Settings Button" type="TextureButton" parent="Menu/Menu Elements/Menu Options/Settings"]
|
||||
margin_left = 77.0
|
||||
margin_right = 138.0
|
||||
margin_bottom = 19.0
|
||||
texture_normal = ExtResource( 1 )
|
||||
texture_hover = ExtResource( 10 )
|
||||
|
||||
[node name="CenterContainer4" type="CenterContainer" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options"]
|
||||
[node name="Credits" type="CenterContainer" parent="Menu/Menu Elements/Menu Options"]
|
||||
margin_top = 60.0
|
||||
margin_right = 83.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 75.0
|
||||
|
||||
[node name="Credits Button" type="TextureButton" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer4"]
|
||||
margin_left = 16.0
|
||||
margin_right = 67.0
|
||||
[node name="Credits Button" type="TextureButton" parent="Menu/Menu Elements/Menu Options/Credits"]
|
||||
margin_left = 82.0
|
||||
margin_right = 133.0
|
||||
margin_bottom = 15.0
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 9 )
|
||||
|
||||
[node name="CenterContainer5" type="CenterContainer" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options"]
|
||||
[node name="Quit" type="CenterContainer" parent="Menu/Menu Elements/Menu Options"]
|
||||
margin_top = 79.0
|
||||
margin_right = 83.0
|
||||
margin_right = 215.0
|
||||
margin_bottom = 94.0
|
||||
|
||||
[node name="Quit Button" type="TextureButton" parent="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer5"]
|
||||
margin_left = 24.0
|
||||
margin_right = 58.0
|
||||
[node name="Quit Button" type="TextureButton" parent="Menu/Menu Elements/Menu Options/Quit"]
|
||||
margin_left = 90.0
|
||||
margin_right = 124.0
|
||||
margin_bottom = 15.0
|
||||
texture_normal = ExtResource( 8 )
|
||||
texture_hover = ExtResource( 11 )
|
||||
@@ -127,17 +127,17 @@ texture_hover = ExtResource( 11 )
|
||||
[node name="BGM" type="AudioStreamPlayer" parent="."]
|
||||
pause_mode = 2
|
||||
stream = ExtResource( 15 )
|
||||
volume_db = -14.136
|
||||
volume_db = -15.0
|
||||
autoplay = true
|
||||
|
||||
[node name="Menu Button Hover" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 16 )
|
||||
volume_db = -15.146
|
||||
volume_db = -16.0
|
||||
|
||||
[connection signal="mouse_entered" from="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer/Continue Button" to="." method="_on_continue_button_mouse_entered"]
|
||||
[connection signal="mouse_entered" from="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer2/New Game Button" to="." method="_on_new_game_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer2/New Game Button" to="." method="_on_new_game_button_pressed"]
|
||||
[connection signal="mouse_entered" from="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer3/Settings Button" to="." method="_on_settings_button_mouse_entered"]
|
||||
[connection signal="mouse_entered" from="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer4/Credits Button" to="." method="_on_credits_button_mouse_entered"]
|
||||
[connection signal="mouse_entered" from="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer5/Quit Button" to="." method="_on_quit_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu Items/VBoxContainer/CenterContainer/Menu Options/CenterContainer5/Quit Button" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Continue/Continue Button" to="." method="_on_continue_button_mouse_entered"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/New Game/New Game Button" to="." method="_on_new_game_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu/Menu Elements/Menu Options/New Game/New Game Button" to="." method="_on_new_game_button_pressed"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Settings/Settings Button" to="." method="_on_settings_button_mouse_entered"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Credits/Credits Button" to="." method="_on_credits_button_mouse_entered"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Elements/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu/Menu Elements/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_pressed"]
|
||||
|
39
GUI/Pause Screen.gd
Normal file
39
GUI/Pause Screen.gd
Normal file
@@ -0,0 +1,39 @@
|
||||
extends CanvasLayer
|
||||
|
||||
|
||||
func _on_resume_button_pressed() -> void:
|
||||
resume()
|
||||
return
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
get_tree().quit()
|
||||
return
|
||||
|
||||
|
||||
func _on_resume_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
||||
func _on_quit_button_mouse_entered() -> void:
|
||||
$'Menu Button Hover'.play(0.0)
|
||||
return
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed('ui_cancel'):
|
||||
if get_tree().paused:
|
||||
resume()
|
||||
else:
|
||||
get_tree().paused = true
|
||||
$Background.visible = true
|
||||
$Menu.visible = true
|
||||
return
|
||||
|
||||
|
||||
func resume() -> void:
|
||||
$Background.visible = false
|
||||
$Menu.visible = false
|
||||
get_tree().paused = false
|
||||
return
|
71
GUI/Pause Screen.tscn
Normal file
71
GUI/Pause Screen.tscn
Normal file
@@ -0,0 +1,71 @@
|
||||
[gd_scene load_steps=8 format=2]
|
||||
|
||||
[ext_resource path="res://Sprites/Assets/Black_Background.png" type="Texture" id=1]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Normal.png" type="Texture" id=2]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Resume_Button_Normal.png" type="Texture" id=3]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Resume_Button_Hover.png" type="Texture" id=4]
|
||||
[ext_resource path="res://Sprites/Menus/Menu Buttons/Quit_Button_Hover.png" type="Texture" id=5]
|
||||
[ext_resource path="res://GUI/Pause Screen.gd" type="Script" id=6]
|
||||
[ext_resource path="res://Sounds/Menu_Button_Hover.wav" type="AudioStream" id=7]
|
||||
|
||||
[node name="Pause Screen" type="CanvasLayer"]
|
||||
pause_mode = 2
|
||||
script = ExtResource( 6 )
|
||||
|
||||
[node name="Background" type="TextureRect" parent="."]
|
||||
visible = false
|
||||
self_modulate = Color( 1, 1, 1, 0.313726 )
|
||||
light_mask = 0
|
||||
rect_min_size = Vector2( 320, 180 )
|
||||
texture = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Menu" type="CenterContainer" parent="."]
|
||||
visible = false
|
||||
margin_left = 80.0
|
||||
margin_top = 10.0
|
||||
margin_right = 240.0
|
||||
margin_bottom = 170.0
|
||||
rect_min_size = Vector2( 160, 160 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Menu Options" type="VBoxContainer" parent="Menu"]
|
||||
margin_left = 49.0
|
||||
margin_top = 63.0
|
||||
margin_right = 111.0
|
||||
margin_bottom = 97.0
|
||||
|
||||
[node name="Resume" type="CenterContainer" parent="Menu/Menu Options"]
|
||||
margin_right = 62.0
|
||||
margin_bottom = 15.0
|
||||
|
||||
[node name="Resume Button" type="TextureButton" parent="Menu/Menu Options/Resume"]
|
||||
margin_right = 62.0
|
||||
margin_bottom = 15.0
|
||||
texture_normal = ExtResource( 3 )
|
||||
texture_hover = ExtResource( 4 )
|
||||
|
||||
[node name="Quit" type="CenterContainer" parent="Menu/Menu Options"]
|
||||
margin_top = 19.0
|
||||
margin_right = 62.0
|
||||
margin_bottom = 34.0
|
||||
|
||||
[node name="Quit Button" type="TextureButton" parent="Menu/Menu Options/Quit"]
|
||||
margin_left = 14.0
|
||||
margin_right = 48.0
|
||||
margin_bottom = 15.0
|
||||
texture_normal = ExtResource( 2 )
|
||||
texture_hover = ExtResource( 5 )
|
||||
|
||||
[node name="Menu Button Hover" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 7 )
|
||||
volume_db = -16.0
|
||||
|
||||
[connection signal="mouse_entered" from="Menu/Menu Options/Resume/Resume Button" to="." method="_on_resume_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu/Menu Options/Resume/Resume Button" to="." method="_on_resume_button_pressed"]
|
||||
[connection signal="mouse_entered" from="Menu/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_mouse_entered"]
|
||||
[connection signal="pressed" from="Menu/Menu Options/Quit/Quit Button" to="." method="_on_quit_button_pressed"]
|
@@ -14,5 +14,5 @@ script = ExtResource( 2 )
|
||||
|
||||
[node name="BGM" type="AudioStreamPlayer" parent="."]
|
||||
stream = ExtResource( 3 )
|
||||
volume_db = -15.146
|
||||
volume_db = -15.0
|
||||
autoplay = true
|
||||
|
Reference in New Issue
Block a user