資源簡介
cocos2dx 3.4 俄羅斯方塊 源代碼及運行文件
代碼片段和文件信息
#include?“AppDelegate.h“
#include?“HelloWorldScene.h“
#include?“StartScene.h“
#include?“GameScene.h“
USING_NS_CC;
AppDelegate::AppDelegate()?{
}
AppDelegate::~AppDelegate()?
{
}
void?AppDelegate::initGLContextAttrs()
{
????//set?OpenGL?context?attributionsnow?can?only?set?six?attributions:
????//redgreenbluealphadepthstencil
????GLContextAttrs?glContextAttrs?=?{8?8?8?8?24?8};
????GLView::setGLContextAttrs(glContextAttrs);
}
bool?AppDelegate::applicationDidFinishLaunching()?{
????//?initialize?director
????auto?director?=?Director::getInstance();
????auto?glview?=?director->getOpenGLView();
????if(!glview)?{
glview?=?GLViewImpl::create(“Tetris“);?//?
glview->setframeSize(480600);
????????director->setOpenGLView(glview);
????}
????//?turn?on?display?FPS
???//?director->setDisplayStats(true);
????//?set?FPS.?the?default?value?is?1.0/60?if?you?don‘t?call?this
????director->setAnimationInterval(1.0?/?60);
????//SimpleAudioEngine::getInstance()->preloadBackgroundMusic(“sounds/game_music.mp3“);????????????
//預讀背景音樂?
//SimpleAudioEngine::getInstance()->preloadEffect(“sounds/game_over.wav“);?
//SimpleAudioEngine::getInstance()->preloadEffect(“sounds/use_bomb.wav“);
auto?myScene?=?StartScene::createScene();
//auto?gameScene?=?GameScene::createScene();
experimental::AudioEngine::play2d(“sounds/game_music.mp3“true);
//?切換場景
director->runWithScene(myScene);
????return?true;
}
//?This?function?will?be?called?when?the?app?is?inactive.?When?comes?a?phone?callit‘s?be?invoked?too
void?AppDelegate::applicationDidEnterBackground()?{
????Director::getInstance()->stopAnimation();
????//?if?you?use?SimpleAudioEngine?it?must?be?pause
????//?SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
}
//?this?function?will?be?called?when?the?app?is?active?again
void?AppDelegate::applicationWillEnterForeground()?{
????Director::getInstance()->startAnimation();
????//?if?you?use?SimpleAudioEngine?it?must?resume?here
????//?SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????778552??2015-03-12?17:06??俄羅斯方塊\run\fonts\arial.ttf
?????文件?????254952??2012-06-01?16:11??俄羅斯方塊\run\fonts\BuxtonSketch.ttf
?????文件??????25776??2015-03-12?17:06??俄羅斯方塊\run\fonts\Marker?Felt.ttf
?????文件?????221696??2015-04-15?11:14??俄羅斯方塊\run\game.exe
?????文件?????331776??2015-02-01?07:23??俄羅斯方塊\run\glew32.dll
?????文件????1664137??2015-04-11?18:41??俄羅斯方塊\run\img\bg.png
?????文件???????1936??2015-03-30?17:19??俄羅斯方塊\run\img\button_1.png
?????文件???????1865??2015-03-30?17:19??俄羅斯方塊\run\img\button_2.png
?????文件???????1941??2015-03-30?17:19??俄羅斯方塊\run\img\button_3.png
?????文件???????1937??2015-03-30?17:19??俄羅斯方塊\run\img\button_4.png
?????文件???????3596??2015-03-12?17:06??俄羅斯方塊\run\img\CloseNormal.png
?????文件???????2810??2015-03-12?17:06??俄羅斯方塊\run\img\CloseSelected.png
?????文件?????369235??2015-03-30?17:22??俄羅斯方塊\run\img\gamebg.png
?????文件??????36843??2015-04-10?20:50??俄羅斯方塊\run\img\gameOver.png
?????文件??????17307??2015-04-11?18:11??俄羅斯方塊\run\img\restart.png
?????文件??????14110??2015-04-11?18:12??俄羅斯方塊\run\img\restart2.png
?????文件??????15422??2015-04-11?18:10??俄羅斯方塊\run\img\return.png
?????文件??????12508??2015-04-11?18:11??俄羅斯方塊\run\img\return2.png
?????文件??????22853??2015-04-11?15:39??俄羅斯方塊\run\img\startGame.png
?????文件??????12370??2015-03-30?16:40??俄羅斯方塊\run\img\startGame2.png
?????文件????4566528??2015-04-11?19:42??俄羅斯方塊\run\libcocos2d.dll
?????文件?????294400??2015-02-01?07:23??俄羅斯方塊\run\libcurl.dll
?????文件????1179648??2015-02-01?07:23??俄羅斯方塊\run\libeay32.dll
?????文件?????149504??2015-02-01?07:23??俄羅斯方塊\run\libmpg123.dll
?????文件??????17920??2015-02-01?07:23??俄羅斯方塊\run\libogg.dll
?????文件?????666624??2015-02-01?07:23??俄羅斯方塊\run\libvorbis.dll
?????文件??????29696??2015-02-01?07:23??俄羅斯方塊\run\libvorbisfile.dll
?????文件?????358400??2015-02-01?07:23??俄羅斯方塊\run\OpenAL32.dll
?????文件??????????0??2015-03-12?17:06??俄羅斯方塊\run\res\.gitkeep
?????文件???????7812??2015-03-19?21:44??俄羅斯方塊\run\res\blue.plist
............此處省略61個文件信息
評論
共有 條評論