android开发之背景音乐与音效 一:添加背景音乐(MediaPlayer) MediaPlayer class can be used to control playback of audio/video files and streams.MediaPlayer 类是用来控制音频和视频文件的播放: 实例化MediaPlayer的方法: 直接new的方式: MediaPlayer mp = new MediaPlayer(); 使用create的方式,如: MediaPlayer mp =…
HelloWorld场景就是游戏中的主菜单场景.HelloWorld.h文件代码如下: #define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" #include "SimpleAudioEngine.h" ① #include "SettingScene.h" class HelloWorld : public coc…