Let's make some HTML5 noise

Unlike our first game, we do have a few sounds for our dragon's story. HTML5 audio is still quite primitive on mobile browsers, but it is satisfactory on desktop browsers and it is a developing specification.

For the purpose of our game, we need only two effects: one for the flapping of dragon's wings and another when he crashes into a tower. You've already seen how to play these effects. These sounds must be listed in the resources.js file and must also be preloaded. We preload them in mainmenu.js with the following commands:

cc.AudioEngine.getInstance().preloadEffect(s_Flap_mp3);
cc.AudioEngine.getInstance().preloadEffect(s_Crash_mp3);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.181