Adding pause screen and updating music files
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
[gd_scene format=3 uid="uid://3e4kxmne50j1"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bvnhuxaptwrdw" path="res://scenes/pause.gd" id="1_wcpj6"]
|
||||
[ext_resource type="FontFile" uid="uid://bcf7oh6t3psng" path="res://assets/fonts/ADVERT_0.TTF" id="2_8v81o"]
|
||||
|
||||
[node name="Pause" type="CanvasLayer" unique_id=191443371]
|
||||
script = ExtResource("1_wcpj6")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="." unique_id=412077959]
|
||||
clip_contents = true
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0.60784316)
|
||||
|
||||
[node name="Label" type="Label" parent="." unique_id=1846226122]
|
||||
anchors_preset = 14
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
offset_top = -11.5
|
||||
offset_bottom = 11.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_fonts/font = ExtResource("2_8v81o")
|
||||
theme_override_font_sizes/font_size = 72
|
||||
text = "PAWSED"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -0,0 +1,21 @@
|
||||
extends CanvasLayer
|
||||
|
||||
@onready var paused:bool = false
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
process_mode = Node.PROCESS_MODE_ALWAYS
|
||||
hide()
|
||||
|
||||
|
||||
func _physics_process(delta):
|
||||
if Input.is_key_pressed(KEY_ESCAPE) and paused == false:
|
||||
await get_tree().create_timer(0.25).timeout
|
||||
paused = true
|
||||
get_tree().paused = true
|
||||
show()
|
||||
elif Input.is_key_pressed(KEY_ESCAPE) and paused == true:
|
||||
await get_tree().create_timer(0.25).timeout
|
||||
paused = false
|
||||
get_tree().paused = false
|
||||
hide()
|
||||
Reference in New Issue
Block a user