This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- cached, sound played based on the name for the sound effect, rather than the file name | |
| SoundManager.map("dropped_bass", "dropped_bass.ogg") | |
| SoundManager.map("explosion", "explosion.ogg") | |
| SoundManager.preload("dropped_bass") | |
| -- Assume a script that does mapping and preloading for each game (based on a data file) | |
| -- volume is in [0, 1], pitch is in [0, inf) | |
| SoundManager.playSound("explosion", volume, pitch) -- Sounds that aren't preloaded are loaded automatically, does not loop |