As a developer creating games for language learning, I want to be able to specify the sound file to be played using an expression, rather than having to pre-select a specific file.
I’m not sure, but is this functionality covered in this card on the Trello roadmap?
Use case 1: Language learning game
My language game supports learning 3 languages. The user can choose which language they want to learn. When the player clicks on an image, it plays the audio for that image in the language the user is learning.
Code: Play the sound [ObjectName + LanguageChoice].wav
Result: Play the sound BeerFrench.wav (or BeerSpanish.wav, BeerEnglish.wav)
Use case 2: Multiple versions of RPG dialog
My RPG game includes dialog in four languages. The user can choose which language they want to play in. When a dialog string plays, it plays in the selected language.
Code: Play the sound [DialogString + Language].wav
Use case 3: Unique environmental sounds
My main character has different types of shields. When each shield collides with an object, it makes a specific sound.
Code: When shield collides with object, Play sound [Collision + ShieldType].wav
Benefit 1: I only need one event in the code to play the sound. Without this function, I need a different event for each language option:
- If language is English, play BeerEnglish.wav
- If language is French, play BeerFrench.wav
Benefit 2: I can add a new language to the game just by adding the language-specific audio resources, and defining the [LanguageChoice] variable.