资源简介
Box2D的简单应用,一个投篮小程序,适合作为教学实例。
代码片段和文件信息
#include “AppDelegate.h“
#include “HelloWorldScene.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);
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLViewImpl::createWithRect(“Box2DNew“ Rect(0 0 640 640));
director->setOpenGLView(glview);
}
director->getOpenGLView()->setDesignResolutionSize(640 640 ResolutionPolicy::SHOW_ALL);
// turn on display FPS
director->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don‘t call this
director->setAnimationInterval(1.0 / 60);
FileUtils::getInstance()->addSearchPath(“res“);
// create a scene. it‘s an autorelease object
auto scene = HelloWorld::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();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6927 2018-10-18 14:08 Resources\arrow.png
文件 8178 2015-04-23 09:29 Resources\ball.png
文件 93 2018-10-18 15:51 Resources\bar.png
文件 28288 2018-10-18 15:29 Resources\basket.png
文件 482122 2017-12-29 13:29 Resources\res\HelloWorld.png
文件 740 2018-10-18 23:23 Resources\res\MainScene.csb
文件 1927 2018-10-18 19:00 Classes\AppDelegate.cpp
文件 987 2017-12-29 13:29 Classes\AppDelegate.h
文件 7219 2018-10-23 16:41 Classes\HelloWorldScene.cpp
文件 834 2018-10-18 23:13 Classes\HelloWorldScene.h
目录 0 2017-12-29 13:29 Resources\res
目录 0 2018-10-18 23:23 Resources
目录 0 2018-10-23 16:41 Classes
----------- --------- ---------- ----- ----
537315 13
- 上一篇:银行核心系统简介
- 下一篇:Octave4.4.1-Windows
相关资源
- cocos2dx 3.2 2048游戏可执行源码
- cocos2dx +lua 斜45度A星寻路算法
- GB2ShapeCache-x 对应cocos2dx 3.x版本创建接
- cocos2dx-3.17 坦克大战游戏 lua代码和资
- cocos2dx v2.2.6 超级玛丽源代码
- cocos2dx模仿人要慌绳子的物理小demo
- Vs2013+cocos2dx贪吃蛇
- cocos2dx3.x使用socket创建服务端和客户端
- GoogleObbDownloadProject
- A星寻路Cocos2dx3.3自动寻路代码
- lua搓牌效果,已实现了四边
- box2d的lua导出LuaBox2D
- cocos2dx实现自定义2D地形
- cocos2dx-3.0功能强大的richText控件源码
- 我所理解的Cocos2dx pdf 地址
- 17种cocos2d-x小游戏源码+素材,从2.x到
- Flash转cocos2dx骨骼动画
- 仿Flappy游戏cocos2dx3.0beta源码BY懒骨头
- CocosCreator小球发射线
- 将.pvr.ccz和plist文件还原为多个原图
- cocos引擎老版本集合cocos2d-x-2.2.1 - 3
- 微软雅黑字体
- spine-runtimes-3.8.rar
- 17种游戏源码+素材
- cocos2d-x Box2d点击随机生成刚体
- 半透明屏蔽罩和弹出框的实现
- cocos2dx 3.x宝石消除小游戏demo
- Cocos2dx游戏开发系列笔记18:《跑酷》
评论
共有 条评论