add aphid poop sounds and plop animations

This commit is contained in:
Teatov 2024-10-21 21:25:27 +10:00
parent cb39aae3fd
commit f24419a86a
22 changed files with 241 additions and 11 deletions

BIN
assets/audio/units/aphid_poop_1.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://4jawklhwlrav"
path="res://.godot/imported/aphid_poop_1.wav-33f37c4812e25b8962c552b6a1c0fc52.sample"
[deps]
source_file="res://assets/audio/units/aphid_poop_1.wav"
dest_files=["res://.godot/imported/aphid_poop_1.wav-33f37c4812e25b8962c552b6a1c0fc52.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
assets/audio/units/aphid_poop_2.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://dqf8u6iyp2gyj"
path="res://.godot/imported/aphid_poop_2.wav-83a83cce31a628fbc3073b451ac4b57f.sample"
[deps]
source_file="res://assets/audio/units/aphid_poop_2.wav"
dest_files=["res://.godot/imported/aphid_poop_2.wav-83a83cce31a628fbc3073b451ac4b57f.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
assets/audio/units/aphid_poop_3.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://d3r846ccllj1i"
path="res://.godot/imported/aphid_poop_3.wav-72f748591dc8803d12958e3ee9523e7c.sample"
[deps]
source_file="res://assets/audio/units/aphid_poop_3.wav"
dest_files=["res://.godot/imported/aphid_poop_3.wav-72f748591dc8803d12958e3ee9523e7c.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
assets/audio/units/aphid_poop_4.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bv1qc7ig8kcov"
path="res://.godot/imported/aphid_poop_4.wav-65fe0cbebdfa264fc54f1fa70e2d9785.sample"
[deps]
source_file="res://assets/audio/units/aphid_poop_4.wav"
dest_files=["res://.godot/imported/aphid_poop_4.wav-65fe0cbebdfa264fc54f1fa70e2d9785.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
assets/audio/units/aphid_poop_5.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://dygm3jfrbsnl3"
path="res://.godot/imported/aphid_poop_5.wav-457add9ec6ed9d68fec96c6c4624adde.sample"
[deps]
source_file="res://assets/audio/units/aphid_poop_5.wav"
dest_files=["res://.godot/imported/aphid_poop_5.wav-457add9ec6ed9d68fec96c6c4624adde.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
assets/audio/units/aphid_poop_6.wav (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://c1536rlvmor6l"
path="res://.godot/imported/aphid_poop_6.wav-c99d1a6bae426c9c90ffc4a2e3355f35.sample"
[deps]
source_file="res://assets/audio/units/aphid_poop_6.wav"
dest_files=["res://.godot/imported/aphid_poop_6.wav-c99d1a6bae426c9c90ffc4a2e3355f35.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
assets/models/ant.glb (Stored with Git LFS)

Binary file not shown.

BIN
assets/models/aphid.glb (Stored with Git LFS)

Binary file not shown.

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://lbs0vilymbum"]
[gd_scene load_steps=15 format=3 uid="uid://lbs0vilymbum"]
[ext_resource type="PackedScene" uid="uid://cidd3q2tet7ku" path="res://scenes/units/abstract/controlled_unit.tscn" id="1_66kao"]
[ext_resource type="Script" path="res://scripts/units/abstract/controlled_ant_unit.gd" id="2_77pj2"]
@ -18,13 +18,31 @@ blend_point_1/node = SubResource("AnimationNodeAnimation_f5jro")
blend_point_1/pos = 1.0
min_space = 0.0
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_gnejs"]
animation = &"plop_down"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_finoi"]
animation = &"plop_up"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_pwnkm"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_67qgu"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_b5tcb"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_v8drs"]
states/locomotion/node = SubResource("AnimationNodeBlendSpace1D_0mwos")
states/locomotion/position = Vector2(334, 100)
transitions = ["Start", "locomotion", SubResource("AnimationNodeStateMachineTransition_pwnkm")]
states/plop_down/node = SubResource("AnimationNodeAnimation_gnejs")
states/plop_down/position = Vector2(457, 39)
states/plop_up/node = SubResource("AnimationNodeAnimation_finoi")
states/plop_up/position = Vector2(499, 90)
transitions = ["Start", "locomotion", SubResource("AnimationNodeStateMachineTransition_pwnkm"), "plop_down", "locomotion", SubResource("AnimationNodeStateMachineTransition_67qgu"), "plop_up", "locomotion", SubResource("AnimationNodeStateMachineTransition_b5tcb")]
[sub_resource type="CylinderShape3D" id="CylinderShape3D_8admi"]
height = 0.5
@ -40,20 +58,39 @@ bones/6/rotation = Quaternion(0.330686, -3.0116e-14, -4.44141e-07, 0.943741)
bones/9/rotation = Quaternion(0.587858, 5.43255e-07, 3.94772e-07, 0.808964)
bones/11/rotation = Quaternion(0.330686, 3.0116e-14, 4.44141e-07, 0.943741)
bones/14/rotation = Quaternion(4.60304e-08, 0.0294697, 0.999566, -5.43234e-07)
bones/14/scale = Vector3(1, 1, 1)
bones/15/rotation = Quaternion(4.55913e-08, 0.0294697, 0.999566, -4.34329e-07)
bones/15/scale = Vector3(1, 1, 1)
bones/16/rotation = Quaternion(4.55913e-08, 0.0294697, 0.999566, -4.34329e-07)
bones/16/scale = Vector3(1, 1, 1)
bones/18/rotation = Quaternion(0.0294712, -6.21995e-15, 4.35675e-07, 0.999566)
bones/19/rotation = Quaternion(0.0294712, -5.33139e-15, 4.35675e-07, 0.999566)
bones/20/rotation = Quaternion(0.0294712, -6.21995e-15, 4.35675e-07, 0.999566)
bones/21/rotation = Quaternion(0.0294712, -6.21995e-15, 4.35675e-07, 0.999566)
bones/22/rotation = Quaternion(0.0294712, -6.21995e-15, 4.35675e-07, 0.999566)
bones/23/rotation = Quaternion(0.0294712, -5.33139e-15, 4.35675e-07, 0.999566)
bones/24/rotation = Quaternion(0.0294712, -6.21995e-15, 4.35675e-07, 0.999566)
bones/25/rotation = Quaternion(0.0294712, -5.33139e-15, 4.35675e-07, 0.999566)
bones/26/rotation = Quaternion(-0.221628, 0.221633, -0.671475, 0.671477)
bones/26/scale = Vector3(1, 1, 1)
bones/27/rotation = Quaternion(0.583948, -8.29882e-08, 2.36539e-06, 0.811791)
bones/27/scale = Vector3(1, 1, 1)
bones/28/rotation = Quaternion(-0.84146, 6.60837e-08, -6.26108e-06, 0.54032)
bones/30/rotation = Quaternion(0.583949, -2.24752e-07, 2.46641e-06, 0.811791)
bones/31/rotation = Quaternion(-0.84146, 1.69298e-07, -6.42962e-06, 0.54032)
bones/32/scale = Vector3(1, 1, 1)
bones/34/rotation = Quaternion(-0.841459, 1.31575e-07, -6.3826e-06, 0.540321)
bones/34/scale = Vector3(1, 1, 1)
bones/35/rotation = Quaternion(-0.221628, -0.221633, 0.671475, 0.671477)
bones/35/scale = Vector3(1, 1, 1)
bones/36/rotation = Quaternion(0.583948, 8.29882e-08, -2.36539e-06, 0.811791)
bones/36/scale = Vector3(1, 1, 1)
bones/37/rotation = Quaternion(-0.84146, -6.60837e-08, 6.26108e-06, 0.54032)
bones/39/rotation = Quaternion(0.583949, 2.24752e-07, -2.46641e-06, 0.811791)
bones/40/rotation = Quaternion(-0.84146, -1.69298e-07, 6.42962e-06, 0.54032)
bones/41/scale = Vector3(1, 1, 1)
bones/43/rotation = Quaternion(-0.841459, -1.31575e-07, 6.3826e-06, 0.540321)
bones/43/scale = Vector3(1, 1, 1)
[node name="GathererMesh" parent="AntModel/Armature/Skeleton3D" index="0"]
visible = false
@ -82,10 +119,10 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.65, 0)
[node name="SelectionIndicator" parent="." index="7"]
transform = Transform3D(0.772715, 0, 0, 0, 0.772715, 0, 0, 0, 0.772715, 0, 0, 0)
[node name="MoveSoundPlayer" parent="." index="10"]
[node name="MoveSoundPlayer" parent="." index="11"]
stream = ExtResource("4_80pw8")
[node name="Decal" parent="." index="11"]
[node name="Decal" parent="." index="12"]
size = Vector3(1.5, 1, 1.5)
[editable path="AntModel"]

View File

@ -48,6 +48,7 @@ mesh = SubResource("BoxMesh_hvf81")
[node name="SoundEffectsPlayer" type="AudioStreamPlayer3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.25, 0)
attenuation_model = 1
script = ExtResource("3_wl62h")
[node name="MoveSoundPlayer" type="AudioStreamPlayer3D" parent="."]

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://bw8cabkva3k4f"]
[gd_scene load_steps=13 format=3 uid="uid://bw8cabkva3k4f"]
[ext_resource type="PackedScene" uid="uid://c70vx0utm5knp" path="res://scenes/units/abstract/unit.tscn" id="1_ghhpv"]
[ext_resource type="Script" path="res://scripts/units/aphid.gd" id="2_c6sy4"]
@ -18,13 +18,22 @@ blend_point_1/node = SubResource("AnimationNodeAnimation_mfl87")
blend_point_1/pos = 1.0
min_space = 0.0
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_vx1kl"]
animation = &"plop"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_17r08"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_vqilr"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_38sa4"]
states/locomotion/node = SubResource("AnimationNodeBlendSpace1D_lgt8u")
states/locomotion/position = Vector2(333, 100)
transitions = ["Start", "locomotion", SubResource("AnimationNodeStateMachineTransition_17r08")]
states/plop/node = SubResource("AnimationNodeAnimation_vx1kl")
states/plop/position = Vector2(468, 47)
transitions = ["Start", "locomotion", SubResource("AnimationNodeStateMachineTransition_17r08"), "plop", "locomotion", SubResource("AnimationNodeStateMachineTransition_vqilr")]
[sub_resource type="SphereShape3D" id="SphereShape3D_t1vrx"]
radius = 0.3

View File

@ -66,6 +66,15 @@ var _press_up_streams: Array[AudioStream] = [
preload("res://assets/audio/ui/press_up_6.wav"),
]
var _aphid_poop_streams: Array[AudioStream] = [
preload("res://assets/audio/units/aphid_poop_1.wav"),
preload("res://assets/audio/units/aphid_poop_2.wav"),
preload("res://assets/audio/units/aphid_poop_3.wav"),
preload("res://assets/audio/units/aphid_poop_4.wav"),
preload("res://assets/audio/units/aphid_poop_5.wav"),
preload("res://assets/audio/units/aphid_poop_6.wav"),
]
func _ready() -> void:
process_mode = Node.PROCESS_MODE_ALWAYS
@ -101,3 +110,7 @@ func press_down() -> AudioStream:
func press_up() -> AudioStream:
return _press_up_streams.pick_random()
func aphid_poop() -> AudioStream:
return _aphid_poop_streams.pick_random()

View File

@ -65,6 +65,7 @@ func _ready() -> void:
assert(listener != null, "listener missing!")
_target_position = StaticNodesManager.player_anthill.global_position
listener.make_current()
UiManager.unit_info.closed.connect(_on_unit_info_closed)
func _process(delta: float) -> void:
@ -90,7 +91,6 @@ func _process(delta: float) -> void:
listener.global_position = _target_position + (Vector3.UP * distance)
listener.global_rotation = global_rotation
UiManager.unit_info.closed.connect(_on_unit_info_closed)
DebugManager.marker("mc_target", _target_position, 0.05)
DebugManager.marker("mc_listener", listener.global_position, 0.05, Color.GREEN)

View File

@ -24,6 +24,9 @@ var _advance_anim_delta_accum: float = 0
@onready var nav_agent: NavigationAgent3D = $NavigationAgent3D
@onready var ui_origin: Node3D = $UiOrigin
@onready var animation_tree: AnimationTree = $AnimationTree
@onready var animation_playback: AnimationNodeStateMachinePlayback = (
animation_tree.get("parameters/playback")
)
@onready var anim_advance_indicator: VisualInstance3D = $AnimAdvanceIndicator
@onready var visibility_notifier: VisibleOnScreenNotifier3D = (
$VisibleOnScreenNotifier3D

View File

@ -87,6 +87,9 @@ func _handle_honeydew_spawn(delta: float) -> void:
new_honeydew.global_position = global_position + new_pos
_put_honeydew(new_honeydew)
audio_player.play_sound(SoundManager.aphid_poop())
animation_playback.travel("plop")
_set_spawn_timer()

View File

@ -146,6 +146,7 @@ func _pick_up() -> void:
_get_nth_pile_pos(_carrying_items.size() - 1)
).tween_finished
audio_player.play_sound(SoundManager.pop())
_unit.animation_playback.travel("plop_down")
await get_tree().create_timer(_pickup_interval).timeout
var nearest := _find_nearest(_nearby_items.values())
@ -167,6 +168,7 @@ func _deposit() -> void:
return
var item := _carrying_items.pop_back() as Honeydew
_unit.animation_playback.travel("plop_up")
audio_player.play_sound(SoundManager.swoosh())
await item.start_tweening(_unit.anthill.global_position).tween_finished