Paddle-Ball/scenes/pauseMenu/pause_menu.gd

38 lines
875 B
GDScript3
Raw Normal View History

2024-07-17 03:00:08 +00:00
extends Control
# Called when the node enters the scene tree for the first time.
func _ready():
$AnimationPlayer.play("RESET")
func resume():
get_tree().paused = false
$AnimationPlayer.play_backwards("blur")
func pause():
get_tree().paused = true
$AnimationPlayer.play("blur")
func Esc():
if Input.is_action_just_pressed("pause") and get_tree().paused == false:
pause()
elif Input.is_action_just_pressed("pause") and get_tree().paused == true:
resume()
# This button will resume the game.
func _on_resume_pressed():
resume()
# This button will restart the game, 0 to 0.
func _on_restart_pressed():
resume()
get_tree().reload_current_scene()
# This is a quit button, this will close the game completly.
func _on_quit_pressed():
get_tree().quit()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
Esc()