hero-mark-2/cutscenes/intro_story.gd

28 lines
951 B
GDScript

extends Node2D
func _ready():
Fade.fade_in(Options.transition_speed_secs)
Audio.play_music(load("res://audio/music/intro.ogg"))
$VoiceOver.play()
func _input(event):
if Input.is_action_just_pressed("ui_accept"):
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance()
func _notification(what: int) -> void:
match what:
NOTIFICATION_WM_FOCUS_OUT:
$AnimationPlayer.playback_active = false
$VoiceOver.stream_paused = true
Audio.ac_music.stream_paused = true
NOTIFICATION_WM_FOCUS_IN:
$AnimationPlayer.playback_active = true
$VoiceOver.stream_paused = false
Audio.ac_music.stream_paused = false
func _on_AnimationPlayer_animation_finished(anim_name):
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance()