- Cocos2d-x Game Development Blueprints
- Karan Sequeira
- 100字
- 2021-07-16 13:47:57
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);
推薦閱讀
- 大學(xué)計算機基礎(chǔ)(第三版)
- R語言經(jīng)典實例(原書第2版)
- ReSharper Essentials
- 零起步玩轉(zhuǎn)掌控板與Mind+
- Java入門經(jīng)典(第6版)
- SpringMVC+MyBatis快速開發(fā)與項目實戰(zhàn)
- Java程序設(shè)計:原理與范例
- Oracle從入門到精通(第5版)
- 區(qū)塊鏈技術(shù)與應(yīng)用
- Babylon.js Essentials
- Hands-On GUI Programming with C++ and Qt5
- Python網(wǎng)絡(luò)爬蟲技術(shù)與應(yīng)用
- 算法圖解
- Data Science Algorithms in a Week
- Android智能手機APP界面設(shè)計實戰(zhàn)教程