资源简介
微信跳一跳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 __MACOSX\Classes\
文件 120 2018-11-06 17:12 __MACOSX\Classes\._.DS_Store
文件 4233 2018-11-06 16:55 Classes\AppDelegate.cpp
文件 176 2018-11-06 16:55 __MACOSX\Classes\._AppDelegate.cpp
文件 2225 2018-11-06 16:40 Classes\AppDelegate.h
文件 3788 2018-11-09 20:09 Classes\HelloWorldScene.cpp
文件 176 2018-11-09 20:09 __MACOSX\Classes\._HelloWorldScene.cpp
文件 1697 2018-11-06 16:40 Classes\HelloWorldScene.h
文件 176 2018-11-06 16:40 __MACOSX\Classes\._HelloWorldScene.h
目录 0 2018-11-10 15:32 Classes\Jump\
文件 4467 2018-11-10 10:37 Classes\Jump\BoxManagerNode.cpp
目录 0 2018-11-10 15:55 __MACOSX\Classes\Jump\
文件 333 2018-11-10 10:37 __MACOSX\Classes\Jump\._BoxManagerNode.cpp
文件 1130 2018-11-09 17:21 Classes\Jump\BoxManagerNode.h
文件 333 2018-11-09 17:21 __MACOSX\Classes\Jump\._BoxManagerNode.h
文件 3920 2018-11-10 11:06 Classes\Jump\BoxSprite.cpp
文件 176 2018-11-10 11:06 __MACOSX\Classes\Jump\._BoxSprite.cpp
文件 655 2018-11-09 17:18 Classes\Jump\BoxSprite.h
文件 176 2018-11-09 17:18 __MACOSX\Classes\Jump\._BoxSprite.h
文件 247 2018-11-09 18:01 Classes\Jump\JumpConst.h
文件 423 2018-11-09 18:01 __MACOSX\Classes\Jump\._JumpConst.h
文件 942 2018-11-10 11:39 Classes\Jump\JumpPla
文件 176 2018-11-10 11:39 __MACOSX\Classes\Jump\._JumpPla
文件 486 2018-11-08 19:59 Classes\Jump\JumpPla
文件 176 2018-11-08 19:59 __MACOSX\Classes\Jump\._JumpPla
文件 8222 2018-11-10 15:32 Classes\Jump\JumpScene.cpp
文件 176 2018-11-10 15:32 __MACOSX\Classes\Jump\._JumpScene.cpp
文件 974 2018-11-10 14:23 Classes\Jump\JumpScene.h
............此处省略82个文件信息
- 上一篇:LORa点对点程序
- 下一篇:大型CDN网络的实现技术研究
评论
共有 条评论