Skip to content

Instantly share code, notes, and snippets.

@ekelokorpi
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekelokorpi/bda6b3ddb7f287dc57f7 to your computer and use it in GitHub Desktop.
Save ekelokorpi/bda6b3ddb7f287dc57f7 to your computer and use it in GitHub Desktop.
Audio: Volume
// Define volume in config
pandaConfig = {
audio: {
soundVolume: 1.0,
musicVolume: 0.5
}
};
// Set main sound volume to 50%
game.audio.setSoundVolume(0.5);
// Set main music volume to 20%
game.audio.setMusicVolume(0.2);
// Change individual sound volume
var mySound = game.audio.playSound('jump');
game.audio.setVolume(mySound, 0.8);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment