• 大小: 78KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: 其他
  • 标签: cocos2d-x  完整RPG  

资源简介

cocos2d-x完整RPG游戏源代码

资源截图

代码片段和文件信息

#include “AppDelegate.h“
#include “LoginScene.h“
#include “BattleScene.h“
#include “SceneGame.h“
#include “LoginScene.h“
USING_NS_CC;
//www.9miao.com
AppDelegate::AppDelegate() {

}

AppDelegate::~AppDelegate() 
{
}

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    CCDirector* pDirector = CCDirector::sharedDirector();
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

    pDirector->setOpenGLView(pEGLView);
    CCSize screenSize = CCEGLView::sharedOpenGLView()->getframeSize();
    float x=screenSize.height/screenSize.width;
    CCSize designSize=CCSizeMake(640640*x);
    CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width designSize.height kResolutionShowAll);
    // turn on display FPS
    //pDirector->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don‘t call this
    pDirector->setAnimationInterval(1.0 / 60);

    bool bfirst=CCUserDefault::sharedUserDefault()->getBoolForKey(“first“false);
    if(!bfirst)
    {
    CCUserDefault::sharedUserDefault()->setBoolForKey(“first“true);
    CCUserDefault::sharedUserDefault()->flush();
    CCScene *pScene=LoginScene::scene();
    // run
    pDirector->runWithScene(pScene);
    }
    else
    {
        CCScene *pScene = new SceneGame(0);
        pDirector->runWithScene(pScene);
    }
    return true;
}

// This function will be called when the app is inactive. When comes a phone callit‘s be invoked too
void AppDelegate::applicationDidEnterBackground() {
    CCDirector::sharedDirector()->stopAnimation();

    // if you use SimpleAudioEngine it must be pause
    SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();
}

// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
    CCDirector::sharedDirector()->startAnimation();

    // if you use SimpleAudioEngine it must resume here
    SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      24580  2014-05-20 12:17  Classes\.DS_Store

     文件       1975  2014-04-10 18:25  Classes\AppDelegate.cpp

     文件        955  2013-10-25 09:39  Classes\AppDelegate.h

     文件       2878  2013-12-21 22:27  Classes\BaoWulayer.cpp

     文件        578  2013-12-21 22:27  Classes\BaoWulayer.h

     文件      34880  2014-04-13 10:36  Classes\BattleScene.cpp

     文件       2459  2014-04-09 09:56  Classes\BattleScene.h

     文件        650  2014-01-07 14:47  Classes\Bullet.cpp

     文件        537  2014-01-07 14:46  Classes\Bullet.h

     文件       5429  2014-04-04 15:36  Classes\Config.cpp

     文件       1535  2014-03-12 11:48  Classes\Config.h

     文件      18079  2014-04-10 19:05  Classes\Effect.cpp

     文件        971  2014-03-13 11:21  Classes\Effect.h

     文件       7600  2014-04-10 13:55  Classes\Fightlayer.cpp

     文件       2161  2014-04-07 20:59  Classes\Fightlayer.h

     文件      24012  2014-04-10 19:02  Classes\GameData.cpp

     文件       4037  2014-04-10 19:00  Classes\GameData.h

     文件       6083  2014-04-09 15:48  Classes\GameMaplayer.cpp

     文件        788  2014-04-06 19:22  Classes\GameMaplayer.h

     文件       6543  2014-04-09 16:08  Classes\GameOver.cpp

     文件        932  2014-04-06 20:19  Classes\GameOver.h

     文件       1209  2014-04-09 18:00  Classes\GetHerolayer.cpp

     文件        600  2014-03-25 11:30  Classes\GetHerolayer.h

     文件       8639  2014-04-09 19:16  Classes\Grouplayer.cpp

     文件       1047  2015-08-11 17:45  Classes\Grouplayer.h

     文件       2842  2013-11-19 14:29  Classes\HelloWorldScene.cpp

     文件        604  2013-11-19 14:29  Classes\HelloWorldScene.h

     文件       7448  2014-04-09 16:39  Classes\HeroInfolayer.cpp

     文件        828  2014-03-12 13:58  Classes\HeroInfolayer.h

     文件       9283  2014-04-09 17:06  Classes\Herolayer.cpp

............此处省略42个文件信息

评论

共有 条评论