step two to squa

This commit is contained in:
pennyrigate 2024-07-13 01:54:54 -04:00
parent 69df2d6ce4
commit fcfaec94a6
2 changed files with 17 additions and 0 deletions

View file

@ -130,3 +130,7 @@ func great_job():
if r > 30 && r <= 60: play_sound(a_great_job_haze,ac_shard)
if r > 60 && r <= 90: play_sound(a_great_job_ivy,ac_shard)
if r > 90: play_sound(a_great_job_dog,ac_shard)
func pause_all(paused: bool) -> void:
for player in get_children():
player.stream_paused = paused

View file

@ -37,12 +37,14 @@ func _on_cutscene_finished() -> void:
func fade() -> void:
Fade.fade_out(0.4)
Game.can_pause = true
yield(Fade, "fade_finished")
sg2083.anims.play("force idle")
Fade.fade_in(0.4)
$"%GUI".visible = true
yield(Fade, "fade_finished")
sg2083.state = sg2083.State.STAND
$FamiCutscene.queue_free()
Game.can_pause = true
Game.can_restart = true
famira.state_chart.send_event("transformed")
@ -83,3 +85,14 @@ func _on_death_cooldown() -> void:
Game.change_map(LevelData.levels[Game.current_level].scene)
else:
Game.change_map(load("res://cutscenes/ending_future.tscn"))
func _notification(what: int) -> void:
match what:
NOTIFICATION_WM_FOCUS_OUT:
if !Game.can_pause:
Audio.pause_all(true)
get_tree().paused = true
NOTIFICATION_WM_FOCUS_IN:
if !Game.can_pause:
Audio.pause_all(false)
get_tree().paused = false