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

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);
主站蜘蛛池模板: 宣威市| 娄底市| 石家庄市| 三门县| 建宁县| 英吉沙县| 明水县| 隆安县| 安塞县| 交城县| 呼图壁县| 克山县| 开鲁县| 邹城市| 同仁县| 太谷县| 深圳市| 色达县| 南安市| 乌兰县| 遵义市| 砚山县| 永登县| 西昌市| 手游| 句容市| 阿拉尔市| 吴堡县| 新余市| 衡山县| 绥德县| 辉南县| 华阴市| 体育| 长子县| 沭阳县| 四子王旗| 泰安市| 郸城县| 承德县| 白银市|