mirror of
https://github.com/deunix-educ/aventuriers-des-mots.git
synced 2026-10-13 02:11:58 +02:00
Add sound effects, ambient music and volume mixing (0.5.0)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
class_name SoundCatalog
|
||||
extends RefCounted
|
||||
## Identifiants des effets sonores et des musiques, resolus vers un fichier
|
||||
## d'un repertoire fixe (jamais de chemin libre : voir CLAUDE.md). Code pur.
|
||||
|
||||
const SFX_DIR := "res://assets/audio/sfx"
|
||||
const MUSIC_DIR := "res://assets/audio/music"
|
||||
|
||||
const SFX_IDS: Array[String] = ["click", "success", "try_again", "star", "fanfare"]
|
||||
const MUSIC_IDS: Array[String] = ["forest", "marsh"]
|
||||
|
||||
|
||||
static func sfx_path(sfx_id: String) -> String:
|
||||
if not SFX_IDS.has(sfx_id):
|
||||
return ""
|
||||
return "%s/%s.ogg" % [SFX_DIR, sfx_id]
|
||||
|
||||
|
||||
static func music_path(music_id: String) -> String:
|
||||
if not MUSIC_IDS.has(music_id):
|
||||
return ""
|
||||
return "%s/%s.ogg" % [MUSIC_DIR, music_id]
|
||||
|
||||
|
||||
## Musique d'une region selon le niveau scolaire de la regle.
|
||||
static func music_for_level(level: String) -> String:
|
||||
return "marsh" if level == "CE2" else "forest"
|
||||
Reference in New Issue
Block a user