资源简介
保卫萝卜cocos2d源码
[注:本内容来自网络,在此分享仅为帮助有需要的网友,如果侵犯了您的权利,麻烦联系我,我会第一时间删除,谢谢您。]
代码片段和文件信息
#include “AppDelegate.h“
#include “SceneManager.h“
#include “CsvUtil.h“
#include “Config.h“
#include “GameScene.h“
#include “SoundUtil.h“
USING_NS_CC;
AppDelegate::AppDelegate()
{
}
AppDelegate::~AppDelegate()
{
SceneManager::destroyInstance();
Config::getInstance()->saveSoundConfig();
Config::destroyInstance();
SoundUtil::destroyInstance();
unLoadSource();
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview)
{
glview = GLViewImpl::create(“My Game“);
director->setOpenGLView(glview);
}
glview->setDesignResolutionSize(960 640 ResolutionPolicy::EXACT_FIT);
// 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);
preLoadSource();
Config::getInstance()->setSoundConfig();
SceneManager::getInstance()->initWelComeScene();
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();
auto pCurScene = Director::getInstance()->getRunningScene();
if ((pCurScene != NULL) && pCurScene->getName() == “GameScene“)
{
auto pGameScene = dynamic_cast(pCurScene);
if(!pGameScene->getChildByName(“CoundDown“) && !pGameScene->getChildByName(“GameEnd“))
dynamic_cast(pCurScene)->clickChooseItem();
}
// if you use SimpleAudioEngine it must resume here
// SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
}
void AppDelegate::preLoadSource()
{
SpriteframeCache::getInstance()->addSpriteframesWithFile(“Themes/scene/mainscene1-hd.plist“ “Themes/scene/mainscene1-hd.png“);
// SpriteframeCache::getInstance()->addSpriteframesWithFile(“Themes/scene/themescene1-hd.plist“ “Themes/scene/themescene1-hd.png“);
// SpriteframeCache::getInstance()->addSpriteframesWithFile(“Themes/Items/Items00-hd.plist“ “Themes/Items/Items00-hd.png“);
auto pCsvUtil = CsvUtil::getInstance();
pCsvUtil->addFileData(BARRIERCSVFILE);
pCsvUtil->addFileData(TOWERCSVFILE);
pCsvUtil->addFileData(MONSTERCSVFILE);
pCsvUtil->addFileData(BULLETCSVFILE);
pCsvUtil->addFileData(LEVELCSVFILE);
}
void AppDelegate::unLoadSource()
{
SpriteframeCache::getInstance()->removeSpriteframes();
CsvUtil::destroyInstance();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1156 2016-04-16 15:10 保卫萝卜cocos2d源码\JavaApk源码说明.txt
文件 203 2015-06-03 23:55 保卫萝卜cocos2d源码\下载更多打包源码~.url
文件 2875 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\AppDelegate.cpp
文件 1041 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\AppDelegate.h
文件 965 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Barrierba
文件 567 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Barrierba
文件 531 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BarrierFactory.cpp
文件 378 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BarrierFactory.h
文件 1888 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BarrierManager.cpp
文件 1197 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BarrierManager.h
文件 308 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Barriersla
文件 448 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Barriersla
文件 6157 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletAnchor.cpp
文件 313 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletAnchor.h
文件 3932 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Bulletba
文件 1180 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Bulletba
文件 2813 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletBlueStar.cpp
文件 471 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletBlueStar.h
文件 1113 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletFactory.cpp
文件 419 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletFactory.h
文件 550 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletLittleAnchor.cpp
文件 260 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletLittleAnchor.h
文件 1173 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletManager.cpp
文件 1069 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletManager.h
文件 1577 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletPin.cpp
文件 304 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletPin.h
文件 1430 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletRocket.cpp
文件 459 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\BulletRocket.h
文件 442 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Bulletsla
文件 469 2016-01-15 15:31 保卫萝卜cocos2d源码\保卫萝卜cocos2d源码\Classes\Bulletsla
............此处省略1037个文件信息
评论
共有 条评论