diff --git a/assets/audio/units/aphid_poop_1.wav b/assets/audio/units/aphid_poop_1.wav new file mode 100644 index 0000000..38567e2 --- /dev/null +++ b/assets/audio/units/aphid_poop_1.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:586aa93e3bcc840d064e9e2764943d9108f2d94c9358c562fc8e3b75f40bd73a +size 51680 diff --git a/assets/audio/units/aphid_poop_1.wav.import b/assets/audio/units/aphid_poop_1.wav.import new file mode 100644 index 0000000..2c09220 --- /dev/null +++ b/assets/audio/units/aphid_poop_1.wav.import @@ -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 diff --git a/assets/audio/units/aphid_poop_2.wav b/assets/audio/units/aphid_poop_2.wav new file mode 100644 index 0000000..549b63a --- /dev/null +++ b/assets/audio/units/aphid_poop_2.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df6f04934c64c7f5108784dcfc5ca6783d2c884cc41b6b7ab66d2b7eea9fb055 +size 39358 diff --git a/assets/audio/units/aphid_poop_2.wav.import b/assets/audio/units/aphid_poop_2.wav.import new file mode 100644 index 0000000..f80351d --- /dev/null +++ b/assets/audio/units/aphid_poop_2.wav.import @@ -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 diff --git a/assets/audio/units/aphid_poop_3.wav b/assets/audio/units/aphid_poop_3.wav new file mode 100644 index 0000000..4a5ed2b --- /dev/null +++ b/assets/audio/units/aphid_poop_3.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:33878c856530e93f4a65ac2fd528cbc28a8a7dfc8a25369726c45806d85aa8b5 +size 38238 diff --git a/assets/audio/units/aphid_poop_3.wav.import b/assets/audio/units/aphid_poop_3.wav.import new file mode 100644 index 0000000..2bd888a --- /dev/null +++ b/assets/audio/units/aphid_poop_3.wav.import @@ -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 diff --git a/assets/audio/units/aphid_poop_4.wav b/assets/audio/units/aphid_poop_4.wav new file mode 100644 index 0000000..9372e59 --- /dev/null +++ b/assets/audio/units/aphid_poop_4.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f500f2c00a60da10641d0efd3169ecceeddf840f909b9b794e9178dc6c3e348 +size 38238 diff --git a/assets/audio/units/aphid_poop_4.wav.import b/assets/audio/units/aphid_poop_4.wav.import new file mode 100644 index 0000000..74635a3 --- /dev/null +++ b/assets/audio/units/aphid_poop_4.wav.import @@ -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 diff --git a/assets/audio/units/aphid_poop_5.wav b/assets/audio/units/aphid_poop_5.wav new file mode 100644 index 0000000..d6f23ed --- /dev/null +++ b/assets/audio/units/aphid_poop_5.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0494bf886ad7735893d330d874eb53822ec4e53c8f6f26160ba8b790fad4ca2 +size 40478 diff --git a/assets/audio/units/aphid_poop_5.wav.import b/assets/audio/units/aphid_poop_5.wav.import new file mode 100644 index 0000000..61d3061 --- /dev/null +++ b/assets/audio/units/aphid_poop_5.wav.import @@ -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 diff --git a/assets/audio/units/aphid_poop_6.wav b/assets/audio/units/aphid_poop_6.wav new file mode 100644 index 0000000..c49412d --- /dev/null +++ b/assets/audio/units/aphid_poop_6.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3df7a607008bdbd12df50d9fe4fbbb84fa7e672f9773b539a81e6391152c7a72 +size 48320 diff --git a/assets/audio/units/aphid_poop_6.wav.import b/assets/audio/units/aphid_poop_6.wav.import new file mode 100644 index 0000000..46bcaaf --- /dev/null +++ b/assets/audio/units/aphid_poop_6.wav.import @@ -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 diff --git a/assets/models/ant.glb b/assets/models/ant.glb index 03adf14..a456c9f 100644 --- a/assets/models/ant.glb +++ b/assets/models/ant.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:86cff706db648095ad2db5cc471ad24fec3c98dae6e79fa9fc9265bb06992d4f -size 299044 +oid sha256:bd49675aaec2bb4d6c960a97717e8e7c1b8db31b272b0e2fa7a6fc3a26a00342 +size 370924 diff --git a/assets/models/aphid.glb b/assets/models/aphid.glb index 4abdca0..591cc87 100644 --- a/assets/models/aphid.glb +++ b/assets/models/aphid.glb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2626dc7ce38de824cb1fc1dd4a6ca89ddff959b93de3660418396a3b3a5ee777 -size 79236 +oid sha256:f6a8bd50af0a5537a5fd6817515bae24a8027ce2234dfc80f3c54c337cf12388 +size 79708 diff --git a/scenes/units/abstract/controlled_ant_unit.tscn b/scenes/units/abstract/controlled_ant_unit.tscn index 123428f..93005d2 100644 --- a/scenes/units/abstract/controlled_ant_unit.tscn +++ b/scenes/units/abstract/controlled_ant_unit.tscn @@ -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"] diff --git a/scenes/units/abstract/unit.tscn b/scenes/units/abstract/unit.tscn index f61271c..8c28eb8 100644 --- a/scenes/units/abstract/unit.tscn +++ b/scenes/units/abstract/unit.tscn @@ -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="."] diff --git a/scenes/units/aphid.tscn b/scenes/units/aphid.tscn index 73ae7eb..2d710e6 100644 --- a/scenes/units/aphid.tscn +++ b/scenes/units/aphid.tscn @@ -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 diff --git a/scripts/globals/sound_manager.gd b/scripts/globals/sound_manager.gd index 2f963b1..44c337a 100644 --- a/scripts/globals/sound_manager.gd +++ b/scripts/globals/sound_manager.gd @@ -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() diff --git a/scripts/main_camera.gd b/scripts/main_camera.gd index 20b8387..d213a87 100644 --- a/scripts/main_camera.gd +++ b/scripts/main_camera.gd @@ -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) diff --git a/scripts/units/abstract/unit.gd b/scripts/units/abstract/unit.gd index 46334de..93ecde7 100644 --- a/scripts/units/abstract/unit.gd +++ b/scripts/units/abstract/unit.gd @@ -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 diff --git a/scripts/units/aphid.gd b/scripts/units/aphid.gd index e75987a..489362c 100644 --- a/scripts/units/aphid.gd +++ b/scripts/units/aphid.gd @@ -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() diff --git a/scripts/units/components/gathering.gd b/scripts/units/components/gathering.gd index 49c1f17..e1cb33b 100644 --- a/scripts/units/components/gathering.gd +++ b/scripts/units/components/gathering.gd @@ -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