跳一跳cocos2d


微信跳一跳cocos2d版本,代码结构简单,可直接使用,cocos2d版本3.0以上
资源截图
代码片段和文件信息
/****************************************************************************
 Copyright (c) 2017-2018 Xiamen Yaji Software Co. Ltd.
 
 http://www.cocos2d-x.org
 
 Permission is hereby granted free of charge to any person obtaining a copy
 of this software and associated documentation files (the “Software“) to deal
 in the Software without restriction including without limitation the rights
 to use copy modify merge publish distribute sublicense and/or sell
 copies of the Software and to permit persons to whom the Software is
 furnished to do so subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
 IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
 LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 ****************************************************************************/

#include “AppDelegate.h“
#include “HelloWorldScene.h“

// #define USE_AUDIO_ENGINE 1
// #define USE_SIMPLE_AUDIO_ENGINE 1

#if USE_AUDIO_ENGINE && USE_SIMPLE_AUDIO_ENGINE
#error “Don‘t use AudioEngine and SimpleAudioEngine at the same time. Please just select one in your game!“
#endif



USING_NS_CC;



AppDelegate::AppDelegate()
{
}

AppDelegate::~AppDelegate() 
{
#if USE_AUDIO_ENGINE
    AudioEngine::end();
#elif USE_SIMPLE_AUDIO_ENGINE
    SimpleAudioEngine::end();
#endif
}

// if you want a different context modify the value of glContextAttrs
// it will affect all platforms
void AppDelegate::initGLContextAttrs()
{
    // set OpenGL context attributes: redgreenbluealphadepthstencilmultisamplesCount
    GLContextAttrs glContextAttrs = {8 8 8 8 24 8 0};

    GLView::setGLContextAttrs(glContextAttrs);
}

// if you want to use the package manager to install more packages  
// don‘t modify or remove this function
static int register_all_packages()
{
    return 0; //flag for packages manager
}

bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
        glview = GLViewImpl::createWithRect(“tiaoyitiao“ cocos2d::Rect(0 0 designResolutionSize.width designResolutionSize.height));
#else
        glview = GLViewImpl::create(“tiaoyitiao“);
#endif
        director->setOpenGLView(glview);
    }

    // turn on display FPS
    director->setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don‘t cal

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-11-09 20:09  Classes
     文件        6148  2018-11-06 17:12  Classes.DS_Store
     目录           0  2018-11-10 15:55  __MACOSX
     目录           0  2018-11-10 15:55  __MACOSXClasses
     文件         120  2018-11-06 17:12  __MACOSXClasses._.DS_Store
     文件        4233  2018-11-06 16:55  ClassesAppDelegate.cpp
     文件         176  2018-11-06 16:55  __MACOSXClasses._AppDelegate.cpp
     文件        2225  2018-11-06 16:40  ClassesAppDelegate.h
     文件        3788  2018-11-09 20:09  ClassesHelloWorldScene.cpp
     文件         176  2018-11-09 20:09  __MACOSXClasses._HelloWorldScene.cpp
     文件        1697  2018-11-06 16:40  ClassesHelloWorldScene.h
     文件         176  2018-11-06 16:40  __MACOSXClasses._HelloWorldScene.h
     目录           0  2018-11-10 15:32  ClassesJump
     文件        4467  2018-11-10 10:37  ClassesJumpBoxManagerNode.cpp
     目录           0  2018-11-10 15:55  __MACOSXClassesJump
     文件         333  2018-11-10 10:37  __MACOSXClassesJump._BoxManagerNode.cpp
     文件        1130  2018-11-09 17:21  ClassesJumpBoxManagerNode.h
     文件         333  2018-11-09 17:21  __MACOSXClassesJump._BoxManagerNode.h
     文件        3920  2018-11-10 11:06  ClassesJumpBoxSprite.cpp
     文件         176  2018-11-10 11:06  __MACOSXClassesJump._BoxSprite.cpp
     文件         655  2018-11-09 17:18  ClassesJumpBoxSprite.h
     文件         176  2018-11-09 17:18  __MACOSXClassesJump._BoxSprite.h
     文件         247  2018-11-09 18:01  ClassesJumpJumpConst.h
     文件         423  2018-11-09 18:01  __MACOSXClassesJump._JumpConst.h
     文件         942  2018-11-10 11:39  ClassesJumpJumpPlayer.cpp
     文件         176  2018-11-10 11:39  __MACOSXClassesJump._JumpPlayer.cpp
     文件         486  2018-11-08 19:59  ClassesJumpJumpPlayer.h
     文件         176  2018-11-08 19:59  __MACOSXClassesJump._JumpPlayer.h
     文件        8222  2018-11-10 15:32  ClassesJumpJumpScene.cpp
     文件         176  2018-11-10 15:32  __MACOSXClassesJump._JumpScene.cpp
     文件         974  2018-11-10 14:23  ClassesJumpJumpScene.h
............此处省略82个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)