create sound_manager and add gathering sounds
This commit is contained in:
parent
4f6cd88eb0
commit
024bc2b7d9
@ -14,6 +14,6 @@ If you want to clone the repo, make sure you have [Git LFS](https://git-lfs.com/
|
||||
- 3D art - Blender
|
||||
|
||||
### For audio
|
||||
- Audio editing - Kdenlive
|
||||
- Audio editing - Audacity
|
||||
- Nature sounds - a nearby forest
|
||||
- Other sounds - my mouth
|
||||
|
||||
BIN
assets/audio/units/pop_1.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/pop_1.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/pop_1.wav.import
Normal file
24
assets/audio/units/pop_1.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://csngjq4byvrdy"
|
||||
path="res://.godot/imported/pop_1.wav-b14b7bf1d45342befdcebb4b9f13e5b3.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/pop_1.wav"
|
||||
dest_files=["res://.godot/imported/pop_1.wav-b14b7bf1d45342befdcebb4b9f13e5b3.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/pop_2.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/pop_2.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/pop_2.wav.import
Normal file
24
assets/audio/units/pop_2.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://clxy3qx80ir7i"
|
||||
path="res://.godot/imported/pop_2.wav-c0a1a70fb183ff277dd7531b5cb9ddd1.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/pop_2.wav"
|
||||
dest_files=["res://.godot/imported/pop_2.wav-c0a1a70fb183ff277dd7531b5cb9ddd1.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/pop_3.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/pop_3.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/pop_3.wav.import
Normal file
24
assets/audio/units/pop_3.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://d3dv13qeafhu0"
|
||||
path="res://.godot/imported/pop_3.wav-a8e80302e6bbc9800aaa6c0b6da3aadb.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/pop_3.wav"
|
||||
dest_files=["res://.godot/imported/pop_3.wav-a8e80302e6bbc9800aaa6c0b6da3aadb.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/pop_4.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/pop_4.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/pop_4.wav.import
Normal file
24
assets/audio/units/pop_4.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://b1gpknoy0xuuh"
|
||||
path="res://.godot/imported/pop_4.wav-155a7f07037e17c14388424d63a7d96c.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/pop_4.wav"
|
||||
dest_files=["res://.godot/imported/pop_4.wav-155a7f07037e17c14388424d63a7d96c.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/pop_5.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/pop_5.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/pop_5.wav.import
Normal file
24
assets/audio/units/pop_5.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://37pjyanyof25"
|
||||
path="res://.godot/imported/pop_5.wav-ca89570a80287efad26978619f4905b8.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/pop_5.wav"
|
||||
dest_files=["res://.godot/imported/pop_5.wav-ca89570a80287efad26978619f4905b8.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/pop_6.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/pop_6.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/pop_6.wav.import
Normal file
24
assets/audio/units/pop_6.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://dj1jd41emeq20"
|
||||
path="res://.godot/imported/pop_6.wav-6b9653e29d74e6239e6db0cf97137d08.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/pop_6.wav"
|
||||
dest_files=["res://.godot/imported/pop_6.wav-6b9653e29d74e6239e6db0cf97137d08.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/pop_7.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/pop_7.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/pop_7.wav.import
Normal file
24
assets/audio/units/pop_7.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://2678l8sxb1sa"
|
||||
path="res://.godot/imported/pop_7.wav-6779713029f09e91922d325e8ea79894.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/pop_7.wav"
|
||||
dest_files=["res://.godot/imported/pop_7.wav-6779713029f09e91922d325e8ea79894.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/swoosh_1.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/swoosh_1.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/swoosh_1.wav.import
Normal file
24
assets/audio/units/swoosh_1.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://d3rpw1i5dw1nv"
|
||||
path="res://.godot/imported/swoosh_1.wav-348b2bcd5270df9cbcb7f0002f11151c.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/swoosh_1.wav"
|
||||
dest_files=["res://.godot/imported/swoosh_1.wav-348b2bcd5270df9cbcb7f0002f11151c.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/swoosh_2.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/swoosh_2.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/swoosh_2.wav.import
Normal file
24
assets/audio/units/swoosh_2.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://51ad0n2y55c8"
|
||||
path="res://.godot/imported/swoosh_2.wav-e5573e8dca378a6dba848ffe4dfdb695.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/swoosh_2.wav"
|
||||
dest_files=["res://.godot/imported/swoosh_2.wav-e5573e8dca378a6dba848ffe4dfdb695.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/swoosh_3.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/swoosh_3.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/swoosh_3.wav.import
Normal file
24
assets/audio/units/swoosh_3.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://ccwhf63nepsui"
|
||||
path="res://.godot/imported/swoosh_3.wav-8da8ca84d54ed1327515285bebfc8281.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/swoosh_3.wav"
|
||||
dest_files=["res://.godot/imported/swoosh_3.wav-8da8ca84d54ed1327515285bebfc8281.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/swoosh_4.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/swoosh_4.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/swoosh_4.wav.import
Normal file
24
assets/audio/units/swoosh_4.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://crfhie02hqap7"
|
||||
path="res://.godot/imported/swoosh_4.wav-0dbf349b8182e7efbb1d2dd2c2bfa188.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/swoosh_4.wav"
|
||||
dest_files=["res://.godot/imported/swoosh_4.wav-0dbf349b8182e7efbb1d2dd2c2bfa188.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/swoosh_5.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/swoosh_5.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/swoosh_5.wav.import
Normal file
24
assets/audio/units/swoosh_5.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://84y5p1bdpf8"
|
||||
path="res://.godot/imported/swoosh_5.wav-e49d729ca54d7959920c7f1ee2b11baa.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/swoosh_5.wav"
|
||||
dest_files=["res://.godot/imported/swoosh_5.wav-e49d729ca54d7959920c7f1ee2b11baa.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/swoosh_6.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/swoosh_6.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/swoosh_6.wav.import
Normal file
24
assets/audio/units/swoosh_6.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://omguvwc6b3aa"
|
||||
path="res://.godot/imported/swoosh_6.wav-0fb20bdad618fc54fc09d71c6fede4e2.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/swoosh_6.wav"
|
||||
dest_files=["res://.godot/imported/swoosh_6.wav-0fb20bdad618fc54fc09d71c6fede4e2.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/swoosh_7.wav
(Stored with Git LFS)
Normal file
BIN
assets/audio/units/swoosh_7.wav
(Stored with Git LFS)
Normal file
Binary file not shown.
24
assets/audio/units/swoosh_7.wav.import
Normal file
24
assets/audio/units/swoosh_7.wav.import
Normal file
@ -0,0 +1,24 @@
|
||||
[remap]
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamWAV"
|
||||
uid="uid://cfy66yfxusbgb"
|
||||
path="res://.godot/imported/swoosh_7.wav-d3ef1bb3533ed21f46fc607119f1ce0b.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/audio/units/swoosh_7.wav"
|
||||
dest_files=["res://.godot/imported/swoosh_7.wav-d3ef1bb3533ed21f46fc607119f1ce0b.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
|
||||
@ -26,6 +26,7 @@ DebugManager="*res://scripts/globals/debug_manager.gd"
|
||||
UiManager="*res://scripts/globals/ui_manager.gd"
|
||||
HoveringManager="*res://scripts/globals/hovering_manager.gd"
|
||||
SelectionManager="*res://scripts/globals/selection_manager.gd"
|
||||
SoundManager="*res://scripts/globals/sound_manager.gd"
|
||||
|
||||
[debug]
|
||||
|
||||
|
||||
29
scripts/globals/sound_manager.gd
Normal file
29
scripts/globals/sound_manager.gd
Normal file
@ -0,0 +1,29 @@
|
||||
extends Node
|
||||
|
||||
var pop_streams: Array[AudioStream] = [
|
||||
preload("res://assets/audio/units/pop_1.wav"),
|
||||
preload("res://assets/audio/units/pop_2.wav"),
|
||||
preload("res://assets/audio/units/pop_3.wav"),
|
||||
preload("res://assets/audio/units/pop_4.wav"),
|
||||
preload("res://assets/audio/units/pop_5.wav"),
|
||||
preload("res://assets/audio/units/pop_6.wav"),
|
||||
preload("res://assets/audio/units/pop_7.wav"),
|
||||
]
|
||||
|
||||
var swoosh_streams: Array[AudioStream] = [
|
||||
preload("res://assets/audio/units/swoosh_1.wav"),
|
||||
preload("res://assets/audio/units/swoosh_2.wav"),
|
||||
preload("res://assets/audio/units/swoosh_3.wav"),
|
||||
preload("res://assets/audio/units/swoosh_4.wav"),
|
||||
preload("res://assets/audio/units/swoosh_5.wav"),
|
||||
preload("res://assets/audio/units/swoosh_6.wav"),
|
||||
preload("res://assets/audio/units/swoosh_7.wav"),
|
||||
]
|
||||
|
||||
|
||||
func pop() -> AudioStream:
|
||||
return pop_streams.pick_random() as AudioStream
|
||||
|
||||
|
||||
func swoosh() -> AudioStream:
|
||||
return swoosh_streams.pick_random() as AudioStream
|
||||
@ -31,8 +31,6 @@ var pickup_interval: float = DEFAULT_PICKUP_INTERVAL
|
||||
var item_bones: Array[int] = []
|
||||
var showing_after_set: bool = false
|
||||
|
||||
var pickup_sound := preload("res://assets/audio/shwoosh.wav")
|
||||
|
||||
@onready var gathering_center: Vector3 = global_position
|
||||
@onready var collision_shape: CollisionShape3D = $NearbyItemsSearch
|
||||
@onready var radius_indicator: VisualInstance3D = (
|
||||
@ -117,7 +115,10 @@ func on_nav_agent_navigation_finished() -> void:
|
||||
if state == GatherState.PICKING_UP:
|
||||
_pick_up()
|
||||
|
||||
if state == GatherState.DEPOSITING:
|
||||
if (
|
||||
state == GatherState.DEPOSITING
|
||||
and global_position.distance_to(anthill.global_position) < 1
|
||||
):
|
||||
_deposit()
|
||||
|
||||
|
||||
@ -151,14 +152,17 @@ func _pick_up() -> void:
|
||||
if target == null or target.carried:
|
||||
if nearest != null:
|
||||
_go_gather(nearest)
|
||||
elif carrying_items.size() > 0:
|
||||
_go_deposit()
|
||||
return
|
||||
|
||||
carrying_items.append(target)
|
||||
target.set_carried(true)
|
||||
audio_player.play_polyphonic(SoundManager.swoosh())
|
||||
await target.start_moving(
|
||||
_get_nth_pile_pos(carrying_items.size() - 1)
|
||||
).moved
|
||||
audio_player.play_polyphonic(pickup_sound)
|
||||
audio_player.play_polyphonic(SoundManager.pop())
|
||||
|
||||
await get_tree().create_timer(pickup_interval).timeout
|
||||
if carrying_items.size() >= max_carrying or nearest == null:
|
||||
@ -182,13 +186,14 @@ func _deposit() -> void:
|
||||
return
|
||||
|
||||
var item := carrying_items.pop_back() as Honeydew
|
||||
audio_player.play_polyphonic(SoundManager.swoosh())
|
||||
await item.start_moving(anthill.global_position).moved
|
||||
audio_player.play_polyphonic(SoundManager.pop())
|
||||
_erase_honeydew(item)
|
||||
item.queue_free()
|
||||
anthill.deposit_honeydew(1)
|
||||
await get_tree().create_timer(drop_interval).timeout
|
||||
|
||||
state = GatherState.PICKING_UP
|
||||
var nearest := _find_nearest(nearby_items.values())
|
||||
if nearest != null:
|
||||
_go_gather(nearest)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user