Skip to content

Instantly share code, notes, and snippets.

Last active October 12, 2015 12:07
What would you like to do?
How to play sounds (Citrus Engine recipe)
// In the Main class, register the sounds :
sound.addSound("Hurt", {sound:"sounds/hurt.mp3"});
sound.addSound("Collect", {sound:"sounds/collect.mp3"});
sound.addSound("Song", {sound:"sounds/song.mp3",timesToPlay:-1});
// In your GameState play them when needed :
private function handleHeroTakeDamage():void {
private function handleJewelCollected(contact:b2Contact):void {
if (Box2DPhysicsObject.CollisionGetOther(self, contact) != _hero)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment