pausing only possible in map.gd

This commit is contained in:
pennyrigate 2023-03-03 23:05:31 -05:00
parent aa86cbc928
commit 7b6d0197cd
8 changed files with 111 additions and 29 deletions

View file

@ -17,6 +17,14 @@ func _ready():
Audio.play_music(music)
func _physics_process(delta):
if Debug.entry == false && Game.can_pause:
#Pause
if Input.is_action_just_pressed("pause") && !get_tree().paused:
get_parent().add_child(Game.pause_screen.instance())
# restart level
if Input.is_action_just_pressed("restart"):
call_deferred("restart_level")
if Game.golds == 50 && Game.shards == 5:
#Time bonus
collectible_bonus = true
@ -30,3 +38,4 @@ func _physics_process(delta):
time_bonus = true
else:
time_bonus = false