Last active
August 29, 2015 14:08
-
-
Save ekelokorpi/bda6b3ddb7f287dc57f7 to your computer and use it in GitHub Desktop.
Audio: Volume
This file contains 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
// Define volume in config | |
pandaConfig = { | |
audio: { | |
soundVolume: 1.0, | |
musicVolume: 0.5 | |
} | |
}; |
This file contains 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
// 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