goodnight_jellybean/godot/assets/audio/AmbientSound.gd

30 lines
724 B
GDScript3
Raw Normal View History

2023-01-01 02:23:56 -07:00
extends Node
onready var drone_fsm: AnimationNodeStateMachinePlayback = $DroneAudioFSM.get("parameters/playback")
func _ready():
2023-01-03 01:24:44 -07:00
GlobalCursorState.connect("set_camera_zone", self, "check_attic")
2023-01-01 02:23:56 -07:00
$NormalDrone.play()
yield(get_tree().create_timer(.1), "timeout")
$SicklyDrone.play()
2023-01-03 01:24:44 -07:00
var has_scared = false
2023-01-01 02:23:56 -07:00
func _on_AnimationTree_motion_status(value):
if value:
drone_fsm.travel("play_sickly_drone")
else:
drone_fsm.travel("play_normal_drone")
2023-01-03 01:24:44 -07:00
func check_attic(where):
if where == "camera_attic_inner" and not has_scared:
yield(GlobalCursorState, "unfreeze")
$NormalDrone.stop()
$SicklyDrone.stop()
$SicklyDrone2.play()
yield($SicklyDrone2, "finished")
$NormalDrone.play()
$SicklyDrone.play()