资源简介
Vs2013+cocos2dx贪吃蛇,3个场景的切换,代码有注释

代码片段和文件信息
#include “AppDelegate.h“
#include “HomeScene.h“
USING_NS_CC;
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate()
{
}
//if you want a different contextjust modify the value of glContextAttrs
//it will takes effect on all platforms
void AppDelegate::initGLContextAttrs()
{
//set OpenGL context attributionsnow can only set six attributions:
//redgreenbluealphadepthstencil
GLContextAttrs glContextAttrs = {8 8 8 8 24 8};
GLView::setGLContextAttrs(glContextAttrs);
}
// If you want to use packages 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) {
glview = GLViewImpl::create(“My Game“);
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);
register_all_packages();
// create a scene. it‘s an autorelease object
auto scene = HomeScene::CreateScene();
// run
director->runWithScene(scene);
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();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-07-10 23:57 snake\
文件 1959 2016-07-11 20:43 snake\AppDelegate.cpp
文件 987 2016-07-10 02:15 snake\AppDelegate.h
文件 120252 2016-07-10 11:46 snake\apple.png
文件 1454 2016-07-12 00:07 snake\GameOverScene.cpp
文件 282 2016-07-11 20:55 snake\GameOverScene.h
文件 6062 2016-07-11 23:50 snake\HelloWorldScene.cpp
文件 1473 2016-07-12 00:07 snake\HelloWorldScene.h
文件 1103 2016-07-12 00:07 snake\HomeScene.cpp
文件 180 2016-07-11 20:34 snake\HomeScene.h
文件 1941 2016-07-12 00:09 snake\SnakeSprite.cpp
文件 800 2016-07-12 00:07 snake\SnakeSprite.h
- 上一篇:ssh+jbpm项目某集团OA
- 下一篇:改进粒子群算法对BP神经网络的优化
相关资源
- cocos2dx经典三消游戏
- cocos2dx-3.0正式版源代码+完整资源 微信
- xxtea加解密工具win32
- Cocos2dx游戏源代码《萝莉快跑》
- Cocos2dx入门初级教程
- cocos2dx 3.3 跑酷游戏源代码和资源
- 三国跑酷cocos2dx3.2源码
- richer单机完毕源码
- 连连看 cocos2dx 源代码
- cocos2dx 大鱼吃小鱼游戏源代码
- cocos2dx 3.x 水波纹
- cocos2dx 捕鱼游戏代码可以在最新译成
- cocos2dx 3.4 拼图游戏 源代码及运行文件
- 王桂林老师 cocos2dx课件.pdf
- 奇怪大冒险完整项目源码
- cocos2dx 聊天框,带换行光标
- cocos2d-x 2048小游戏源码+素材
- Cocos2d-x滑雪游戏源码.zip
- cocos2dx+JS写的 棋牌 麻将源代码 客户端
- cocos2dx 塔防游戏
- cocos2dx射箭游戏
- Cocos2d-x时钟
- cocos2dx 3.4 俄罗斯方块 源代码及运行文
- KingdomRush(王国保卫战)声音资源
- 精品糖果三消游戏源码 cocos2dx3.10
- cocos2d-x API大全中文版2016
- cocos2dxAPI文档中文版
- RPG文字游戏源码
- 传智播客cocos2dx课程文档
- 2048源码(Cocos2dx)
评论
共有 条评论