资源简介
Cocos2d-x项目实战-射击类游戏-迷失航线,版本是Cocos2d-x-3.2
代码片段和文件信息
#include “AppDelegate.h“
#include “HelloWorldScene.h“
USING_NS_CC;
AppDelegate::AppDelegate()
{
}
AppDelegate::~AppDelegate()
{
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create(“My Game“);
glview->setframeSize(320 480);
director->setOpenGLView(glview);
}
// 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);
//屏幕大小
auto screenSize = glview->getframeSize();
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) //WP8平台下width和height反了
if (screenSize.width > screenSize.height) {
glview->setframeSize(screenSize.height screenSize.width);
screenSize = glview->getframeSize();
}
#endif
//设计分辨率大小
auto designSize = Size(320 480);
//资源大小
auto resourceSize = Size(640 960);
std::vector searchPaths;
if (screenSize.height > 960) { //640x1136
designSize = Size(320 568);
searchPaths.push_back(“hd“);
} else {
searchPaths.push_back(“hd“);
}
director->setContentScaleFactor(resourceSize.width/designSize.width); //默认为1.0f
FileUtils::getInstance()->setSearchPaths(searchPaths);
glview->setDesignResolutionSize(designSize.width designSize.height ResolutionPolicy::FIXED_WIDTH);
// 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();
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2269 2014-11-26 10:27 LostRoutes_final(3.2)\Classes\AppDelegate.cpp
文件 1284 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\AppDelegate.h
文件 1857 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\ba
文件 776 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\ba
文件 1230 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\Bullet.cpp
文件 727 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\Bullet.h
文件 2818 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\Enemy.cpp
文件 1487 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\Enemy.h
文件 1742 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\Fighter.cpp
文件 748 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\Fighter.h
文件 2751 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\GameOverScene.cpp
文件 387 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\GameOverScene.h
文件 14531 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\GamePlayScene.cpp
文件 2423 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\GamePlayScene.h
文件 4333 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\HelloWorldScene.cpp
文件 1160 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\HelloWorldScene.h
文件 3925 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\HelpScene.cpp
文件 925 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\HelpScene.h
文件 3597 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\HomeScene.cpp
文件 1150 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\HomeScene.h
文件 1982 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\MyUtility.cpp
文件 314 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\MyUtility.h
文件 3676 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\SettingScene.cpp
文件 1049 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\SettingScene.h
文件 1146 2014-11-26 10:28 LostRoutes_final(3.2)\Classes\SystemHeader.h
文件 4194692 2014-11-26 10:35 LostRoutes_final(3.2)\Resources\fonts\hanyi.ttf
文件 25776 2014-11-26 10:35 LostRoutes_final(3.2)\Resources\fonts\Marker Felt.ttf
文件 454 2014-11-26 10:44 LostRoutes_final(3.2)\Resources\hd\map\blue_bg.tmx
文件 3184 2014-11-26 10:44 LostRoutes_final(3.2)\Resources\hd\map\blue_tiles.png
文件 454 2014-11-26 10:44 LostRoutes_final(3.2)\Resources\hd\map\red_bg.tmx
............此处省略33个文件信息
- 上一篇:TSM管理员参考大全
- 下一篇:编码器和译码器设计
相关资源
- cocos2d-x飞机大战项目
- Cocos2d-x开发游戏的坐标系知识介绍
- Cocos2d-x 3.x 头像选择器功能扩展Image
- 节奏大师源码
- 炸弹人(cocos2d-x 3.2)
- Cocos2d-x 瓦片地图操作Demo-双指缩放、
- cocos2d-x游戏源码236061
- cocos2d-x 别踩白块源码
- Cocos2d-x《大抗战》塔防射击游戏源代
- 基于cocos开发的飞机大战含素材资源
- BulletWar游戏源码coco2d-x开发 lua
- cocos2d-x塔防实现
- cocos2d-x游戏开发系列教程-坦克大战游
- cocos2d-x 2048小游戏源码+素材
- 坦克大战 类和图片资源
- 游戏:猫狗大作战
- Cocos2d-x滑雪游戏源码.zip
- cocos2d-x完整RPG游戏源代码(配套资源
- 用Cocos2d-x编写大富翁游戏源码,可联
- 植物大战僵尸源码
- TowerDefense cocos2d-x
- Cocos2d-x3.2塔防游戏源代码
- 格斗横版过关类手游cocos2d-x lua源码
- Cocos Studio 创建帧动画
- 使用Cocos2d-X开发中国象棋
- Cocos2d-x时钟
- Cocos2d-x之Lua核心编程_PDF 高清 带索引
- Cocos2d-x高级开发教程:制作自己的《
- cocos2d-x半即时战斗rpg游戏demo源码
- cocos2d-x飞行射击类游戏整套素材资源
评论
共有 条评论