feat(sprint-21): interactive object SFX — 7 new play_sfx wiring calls + AudioManager keys

This commit is contained in:
Steven Wroblewski
2026-05-10 21:15:25 +02:00
17 changed files with 40 additions and 0 deletions
View File
View File
View File
View File
View File
View File
+16
View File
@@ -63,3 +63,19 @@ ffmpeg -i input.wav -c:a libvorbis -q:a 4 output.ogg
- Prefer the primary pick; use the alt only if the primary is unavailable or unsuitable on preview.
- Keep music loops between 3060 s to minimize file size on mobile.
- SFX should be trimmed with a short (~5 ms) fade-out to avoid clicks.
## Sprint 21 — Interactive Object SFX
All CC0 or CC-BY from freesound.org. Replace placeholder 0-byte files with the downloads below.
| File | Description | Freesound suggestion |
|---|---|---|
| `assets/audio/sfx/xray_scan.ogg` | electrical hum / machine beep | search "xray machine beep" or "electrical hum short" |
| `assets/audio/sfx/tea_pour.ogg` | liquid pouring | search "liquid pour short" or "tea pouring" |
| `assets/audio/sfx/cradle_rock.ogg` | gentle creak / lullaby chime | search "gentle creak wood" or "lullaby chime" |
| `assets/audio/sfx/gift_open.ogg` | unwrapping / pop | search "gift unwrap" or "pop sound soft" |
| `assets/audio/sfx/ambulance_siren.ogg` | short siren sting <1.5s child-friendly | search "toy siren short" or "ambulance beep" |
| `assets/audio/sfx/delivery_cheer.ogg` | happy chime / fanfare | search "happy chime short" or "fanfare child" |
| `assets/audio/sfx/object_tap.ogg` | soft tap / click | search "soft tap" or "gentle click" |
All files must be <1.5 s, child-friendly (no harsh/loud sounds), mono or stereo, 44100 Hz, OGG Vorbis.
+7
View File
@@ -20,6 +20,13 @@ const _SFX_MAP: Dictionary = {
"item_drop_outfit": "res://assets/audio/sfx/item_drop_outfit.ogg",
"item_return_chest": "res://assets/audio/sfx/item_return_chest.ogg",
"item_drop_floor": "res://assets/audio/sfx/item_drop_floor.ogg",
"xray_scan": "res://assets/audio/sfx/xray_scan.ogg",
"tea_pour": "res://assets/audio/sfx/tea_pour.ogg",
"cradle_rock": "res://assets/audio/sfx/cradle_rock.ogg",
"gift_open": "res://assets/audio/sfx/gift_open.ogg",
"ambulance_siren": "res://assets/audio/sfx/ambulance_siren.ogg",
"delivery_cheer": "res://assets/audio/sfx/delivery_cheer.ogg",
"object_tap": "res://assets/audio/sfx/object_tap.ogg",
}
var _current_floor: int = -1
+1
View File
@@ -52,6 +52,7 @@ func _input(event: InputEvent) -> void:
func _drive_in() -> void:
AudioManager.play_sfx("ambulance_siren")
_is_animating = true
_is_parked = false
var tween: Tween = create_tween()
+1
View File
@@ -28,6 +28,7 @@ func _input(event: InputEvent) -> void:
func _start_rocking() -> void:
AudioManager.play_sfx("cradle_rock")
_state = State.ROCKING
var tween: Tween = create_tween()
tween.set_ease(Tween.EASE_IN_OUT)
+1
View File
@@ -44,6 +44,7 @@ func _input(event: InputEvent) -> void:
func _start_arrival() -> void:
AudioManager.play_sfx("delivery_cheer")
_state = State.MAMA_ARRIVING
var mama: Node2D = get_node_or_null("Mama") as Node2D
if mama == null:
+1
View File
@@ -33,6 +33,7 @@ func _input(event: InputEvent) -> void:
func _start_opening() -> void:
AudioManager.play_sfx("gift_open")
_state = State.OPENING
var lid: Node2D = get_node_or_null("Lid") as Node2D
if lid == null:
+1
View File
@@ -39,6 +39,7 @@ func _on_area_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) -
func _trigger_interaction() -> void:
AudioManager.play_sfx("object_tap")
_set_state(State.ACTIVE)
object_interacted.emit(self)
GameState.set_object_state(object_id, "active")
+1
View File
@@ -27,6 +27,7 @@ func _input(event: InputEvent) -> void:
func _start_pouring() -> void:
AudioManager.play_sfx("tea_pour")
_state = State.POURING
var tween: Tween = create_tween()
tween.set_ease(Tween.EASE_IN_OUT)
+1
View File
@@ -39,6 +39,7 @@ func _input(event: InputEvent) -> void:
func _start_scan() -> void:
AudioManager.play_sfx("xray_scan")
_state = State.SLIDING_IN
var plate: Node2D = get_node_or_null("Plate") as Node2D
if plate == null:
+10
View File
@@ -73,3 +73,13 @@ func test_music_map_has_all_four_floors() -> void:
func test_default_music_volume_constant_is_0_6() -> void:
assert_eq(AudioManager.DEFAULT_MUSIC_VOLUME, 0.6)
func test_sfx_map_has_all_interactive_object_keys() -> void:
assert_true(AudioManager._SFX_MAP.has("xray_scan"))
assert_true(AudioManager._SFX_MAP.has("tea_pour"))
assert_true(AudioManager._SFX_MAP.has("cradle_rock"))
assert_true(AudioManager._SFX_MAP.has("gift_open"))
assert_true(AudioManager._SFX_MAP.has("ambulance_siren"))
assert_true(AudioManager._SFX_MAP.has("delivery_cheer"))
assert_true(AudioManager._SFX_MAP.has("object_tap"))