官术网_书友最值得收藏!

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);
主站蜘蛛池模板: 白银市| 房山区| 临邑县| 平顺县| 石城县| 奉新县| 丹东市| 东丽区| 乐亭县| 丰台区| 巨鹿县| 沙河市| 大英县| 长汀县| 和田市| 始兴县| 绥棱县| 葵青区| 桃江县| 五台县| 沂水县| 陆川县| 伊通| 铜陵市| 双牌县| 伊春市| 长垣县| 铁岭市| 莱芜市| 南雄市| 当雄县| 交口县| 汾阳市| 朝阳市| 建平县| 邢台市| 桃江县| 龙州县| 合江县| 富平县| 阿克苏市|