Using SoundJS for games

So I was building a new game and wanted to include some sounds and an ambient sound as background music. So I bought a sound from Envato Audio Jungle, and also I asked my cousin to make me an ambient/sci-fi/space sound… He came up with a rather nice composition for a space game.
So I wanted to incorporate all these into my game, so I used one of the best libraries for javascript sound out there, SoundJS

What I did however is to create a custom javascript function/class to handle all of the game sounds and have them ready for playback when I need to fire a bullet or stop the background-sound.

EXAMPLE Here

This is how I did it:
Continue reading

Facebooktwittergoogle_pluspinterestlinkedin
linkedin