scary sound

This commit is contained in:
Spencer Killen 2023-01-03 01:24:44 -07:00
parent c4ceeca1d4
commit d7a766dc9f
Signed by: sjkillen
GPG Key ID: F307025B65C860BA
7 changed files with 54 additions and 5 deletions

View File

@ -0,0 +1,3 @@
source_md5="7c7297785e72c853ef99942fb2a995d0"
dest_md5="92315a7fb8e813c3a546ecd8d2eeb343"

View File

@ -20,13 +20,14 @@ func fire_interact():
func get_cursor(): func get_cursor():
return cursor.get_ref() return cursor.get_ref()
signal freeze(enabled) signal freeze
signal unfreeze
func freeze(): func freeze():
is_frozen = true is_frozen = true
emit_signal("freeze", true) emit_signal("freeze")
func unfreeze(): func unfreeze():
is_frozen = false is_frozen = false
emit_signal("freeze", false) emit_signal("unfreeze")
# Interact events: # Interact events:

View File

@ -3,14 +3,27 @@ extends Node
onready var drone_fsm: AnimationNodeStateMachinePlayback = $DroneAudioFSM.get("parameters/playback") onready var drone_fsm: AnimationNodeStateMachinePlayback = $DroneAudioFSM.get("parameters/playback")
func _ready(): func _ready():
GlobalCursorState.connect("set_camera_zone", self, "check_attic")
$NormalDrone.play() $NormalDrone.play()
yield(get_tree().create_timer(.1), "timeout") yield(get_tree().create_timer(.1), "timeout")
$SicklyDrone.play() $SicklyDrone.play()
var has_scared = false
func _on_AnimationTree_motion_status(value): func _on_AnimationTree_motion_status(value):
if value: if value:
drone_fsm.travel("play_sickly_drone") drone_fsm.travel("play_sickly_drone")
else: else:
drone_fsm.travel("play_normal_drone") drone_fsm.travel("play_normal_drone")
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()

View File

@ -1,8 +1,9 @@
[gd_scene load_steps=13 format=2] [gd_scene load_steps=17 format=2]
[ext_resource path="res://assets/audio/sicky_drone.ogg" type="AudioStream" id=1] [ext_resource path="res://assets/audio/sicky_drone.ogg" type="AudioStream" id=1]
[ext_resource path="res://assets/audio/vocal_drone.ogg" type="AudioStream" id=2] [ext_resource path="res://assets/audio/vocal_drone.ogg" type="AudioStream" id=2]
[ext_resource path="res://assets/audio/AmbientSound.gd" type="Script" id=3] [ext_resource path="res://assets/audio/AmbientSound.gd" type="Script" id=3]
[ext_resource path="res://assets/audio/sicky_drone_2.ogg" type="AudioStream" id=4]
[sub_resource type="Animation" id=1] [sub_resource type="Animation" id=1]
length = 0.001 length = 0.001
@ -88,6 +89,9 @@ tracks/1/keys = {
[sub_resource type="AnimationNodeAnimation" id=4] [sub_resource type="AnimationNodeAnimation" id=4]
animation = "play_normal_drone" animation = "play_normal_drone"
[sub_resource type="AnimationNodeAnimation" id=11]
animation = "play_sicker"
[sub_resource type="AnimationNodeAnimation" id=5] [sub_resource type="AnimationNodeAnimation" id=5]
animation = "play_sickly_drone" animation = "play_sickly_drone"
@ -95,12 +99,18 @@ animation = "play_sickly_drone"
[sub_resource type="AnimationNodeStateMachineTransition" id=7] [sub_resource type="AnimationNodeStateMachineTransition" id=7]
[sub_resource type="AnimationNodeStateMachineTransition" id=12]
[sub_resource type="AnimationNodeStateMachineTransition" id=13]
[sub_resource type="AnimationNodeStateMachine" id=8] [sub_resource type="AnimationNodeStateMachine" id=8]
states/play_normal_drone/node = SubResource( 4 ) states/play_normal_drone/node = SubResource( 4 )
states/play_normal_drone/position = Vector2( 336, 128 ) states/play_normal_drone/position = Vector2( 336, 128 )
states/play_sicker/node = SubResource( 11 )
states/play_sicker/position = Vector2( 524, 446 )
states/play_sickly_drone/node = SubResource( 5 ) states/play_sickly_drone/node = SubResource( 5 )
states/play_sickly_drone/position = Vector2( 683, 227 ) states/play_sickly_drone/position = Vector2( 683, 227 )
transitions = [ "play_normal_drone", "play_sickly_drone", SubResource( 6 ), "play_sickly_drone", "play_normal_drone", SubResource( 7 ) ] transitions = [ "play_normal_drone", "play_sickly_drone", SubResource( 6 ), "play_sickly_drone", "play_normal_drone", SubResource( 7 ), "play_normal_drone", "play_sicker", SubResource( 12 ), "play_sicker", "play_normal_drone", SubResource( 13 ) ]
start_node = "play_normal_drone" start_node = "play_normal_drone"
[sub_resource type="AnimationNodeStateMachinePlayback" id=9] [sub_resource type="AnimationNodeStateMachinePlayback" id=9]
@ -116,6 +126,10 @@ volume_db = -10.0
stream = ExtResource( 1 ) stream = ExtResource( 1 )
volume_db = -10.0 volume_db = -10.0
[node name="SicklyDrone2" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 4 )
volume_db = -10.0
[node name="DroneAudioAnimation" type="AnimationPlayer" parent="."] [node name="DroneAudioAnimation" type="AnimationPlayer" parent="."]
anims/RESET = SubResource( 1 ) anims/RESET = SubResource( 1 )
anims/play_normal_drone = SubResource( 2 ) anims/play_normal_drone = SubResource( 2 )

BIN
godot/assets/audio/sicky_drone_2.ogg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/sicky_drone_2.ogg-2840f8c9e588a8dc24ba32874f0439b2.oggstr"
[deps]
source_file="res://assets/audio/sicky_drone_2.ogg"
dest_files=[ "res://.import/sicky_drone_2.ogg-2840f8c9e588a8dc24ba32874f0439b2.oggstr" ]
[params]
loop=false
loop_offset=0