refining menus and gameplay slightly
This commit is contained in:
35
scenes/menus/pause/pause.gd
Normal file
35
scenes/menus/pause/pause.gd
Normal file
@@ -0,0 +1,35 @@
|
||||
extends Control
|
||||
|
||||
var scene
|
||||
var button_sound
|
||||
var fade
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
scene = get_tree().current_scene
|
||||
button_sound = $ButtonPress
|
||||
|
||||
fade = self.get_parent().get_node("Fade")
|
||||
fade.visible = true
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func resume():
|
||||
button_sound.play()
|
||||
scene.active = true
|
||||
self.visible = false
|
||||
|
||||
func _on_back_pressed() -> void:
|
||||
resume()
|
||||
|
||||
func _on_options_pressed() -> void:
|
||||
pass
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
var tween := create_tween()
|
||||
tween.parallel().tween_property(fade, "modulate:a", 1, 1).set_trans(Tween.TRANS_SINE).set_ease(Tween.EASE_OUT)
|
||||
button_sound.play()
|
||||
await button_sound.finished
|
||||
get_tree().change_scene_to_file("res://scenes/menus/start_menu/title.tscn")
|
||||
1
scenes/menus/pause/pause.gd.uid
Normal file
1
scenes/menus/pause/pause.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://15e0tr7en3iq
|
||||
65
scenes/menus/pause/pause.tscn
Normal file
65
scenes/menus/pause/pause.tscn
Normal file
@@ -0,0 +1,65 @@
|
||||
[gd_scene format=3 uid="uid://dm6jp4gjboooc"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://15e0tr7en3iq" path="res://scenes/menus/pause/pause.gd" id="1_8lsyj"]
|
||||
[ext_resource type="AudioStream" uid="uid://podscahsf0d4" path="res://assets/audio/sfx/MenuAccept.wav" id="2_y88h8"]
|
||||
|
||||
[node name="Pause" type="Control" unique_id=1227462733]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_8lsyj")
|
||||
|
||||
[node name="Dim" type="ColorRect" parent="." unique_id=677985495]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0.29411766)
|
||||
|
||||
[node name="BoxContainer" type="BoxContainer" parent="." unique_id=724874690]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -267.0
|
||||
offset_top = -162.5
|
||||
offset_right = 267.0
|
||||
offset_bottom = 162.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
alignment = 1
|
||||
vertical = true
|
||||
|
||||
[node name="Back" type="Button" parent="BoxContainer" unique_id=2010495470]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Resume"
|
||||
|
||||
[node name="Options" type="Button" parent="BoxContainer" unique_id=1573468039]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Options"
|
||||
|
||||
[node name="Exit" type="Button" parent="BoxContainer" unique_id=870296717]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Back To Title
|
||||
"
|
||||
|
||||
[node name="ButtonPress" type="AudioStreamPlayer2D" parent="." unique_id=1518446961]
|
||||
stream = ExtResource("2_y88h8")
|
||||
volume_db = -10.0
|
||||
|
||||
[connection signal="pressed" from="BoxContainer/Back" to="." method="_on_back_pressed"]
|
||||
[connection signal="pressed" from="BoxContainer/Options" to="." method="_on_options_pressed"]
|
||||
[connection signal="pressed" from="BoxContainer/Exit" to="." method="_on_exit_pressed"]
|
||||
Reference in New Issue
Block a user