enchant.js | Sound examples

Mithat Konar

Sound

Sound support in enchant.js has a history of being fragile and unpredictable. If (when?) you encounter problems, you may (or may not) have success on a different browser than the one you are using. Or it just might be broken for everyone.

Download starter project

Make a sound in response to an event

In the example below, we add a drip sound to our previous Rain Game that is triggered whenever a collision between a droplet and the collector occurs.


    

Run

Add background music


    

Run

Make background music loop


    

Run

Add "game-over" sound


    

Run