资源简介
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经典三消游戏
- cocos2dx-3.0正式版源代码+完整资源 微信
- Introduction to Game Physics with Box2D 无水印
- 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课程文档
评论
共有 条评论