资源简介
cocos2dx写的经典三消小游戏,实现了完整的消除,移动,下降填充,combo等逻辑
代码片段和文件信息
#include “app_delegate.h“
#include “menu_scene.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
#if USE_AUDIO_ENGINE
#include “audio/include/AudioEngine.h“
using namespace cocos2d::experimental;
#elif USE_SIMPLE_AUDIO_ENGINE
#include “audio/include/SimpleAudioEngine.h“
using namespace CocosDenshion;
#endif
USING_NS_CC;
// 水平分辨率
//static cocos2d::Size designResolutionSize = cocos2d::Size(480 320);
//static cocos2d::Size smallResolutionSize = cocos2d::Size(480 320);
//static cocos2d::Size mediumResolutionSize = cocos2d::Size(1024 768);
//static cocos2d::Size largeResolutionSize = cocos2d::Size(2048 1536);
// 竖直分辨率
static cocos2d::Size designResolutionSize = cocos2d::Size(320 480);
static cocos2d::Size smallResolutionSize = cocos2d::Size(320 480);
static cocos2d::Size mediumResolutionSize = cocos2d::Size(768 1024);
static cocos2d::Size largeResolutionSize = cocos2d::Size(1536 2048);
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: redgreenbluealphadepthstencil
GLContextAttrs glContextAttrs = {8 8 8 8 24 8};
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(“MyEliminateGame“ cocos2d::Rect(0 0 designResolutionSize.width designResolutionSize.height));
#else
glview = GLViewImpl::create(“MyEliminateGame“);
#endif
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.0f / 60);
// Set the design resolution
glview->setDesignResolutionSize(designResolutionSize.width designResolutionSize.height ResolutionPolicy::NO_BORDER);
auto frameSize = glview->getframeSize();
// if the frame‘s height is larger than the height of medium size.
if (frameSize.height > mediumResolutionSize.height)
{
director->se
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-07-18 11:13 MyEliminateGame\
目录 0 2018-07-18 11:12 MyEliminateGame\Classes\
文件 4765 2018-06-29 09:16 MyEliminateGame\Classes\app_delegate.cpp
文件 981 2018-06-21 09:20 MyEliminateGame\Classes\app_delegate.h
文件 844 2018-07-13 09:50 MyEliminateGame\Classes\element.cpp
文件 384 2018-07-13 09:47 MyEliminateGame\Classes\element.h
文件 27365 2018-07-18 09:36 MyEliminateGame\Classes\game_scene.cpp
文件 2389 2018-07-17 11:29 MyEliminateGame\Classes\game_scene.h
文件 1502 2018-07-12 13:37 MyEliminateGame\Classes\menu_scene.cpp
文件 275 2018-06-29 09:11 MyEliminateGame\Classes\menu_scene.h
文件 8646 2018-06-21 09:20 MyEliminateGame\CMakeLists.txt
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android\
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\
文件 121 2018-06-21 09:20 MyEliminateGame\proj.android-studio\.gitignore
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\app\
文件 31 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\.gitignore
文件 1218 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\AndroidManifest.xm
文件 3313 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\build.gradle
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\app\jni\
文件 934 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\jni\Android.mk
文件 338 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\jni\Application.mk
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\app\jni\hellocpp\
文件 393 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\jni\hellocpp\main.cpp
文件 678 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\proguard-rules.pro
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\app\res\
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\app\res\mipmap-hdpi\
文件 22975 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\res\mipmap-hdpi\ic_launcher.png
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\app\res\mipmap-mdpi\
文件 19756 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\res\mipmap-mdpi\ic_launcher.png
目录 0 2018-07-18 11:12 MyEliminateGame\proj.android-studio\app\res\mipmap-xhdpi\
文件 26514 2018-06-21 09:20 MyEliminateGame\proj.android-studio\app\res\mipmap-xhdpi\ic_launcher.png
............此处省略118个文件信息
相关资源
- cocos2dx-3.0正式版源代码+完整资源 微信
- 《深入理解计算机系统》随书代码
- glut库glew库glfw库glaux库
- 人脸识别系统设计-毕业设计
- ACM大学生程序设计竞赛在线题库精选
- OpenSSL-win64库使用依赖文件
- 西门子数控系统二次开发
- 多用户多级目录文件系统的实现
- devcpp4990setup
- 俄罗斯方块 SDL 版
- 基于Win socket简单实现一个FTP协议的客
- p2p 的简单实现 上传文件
- 数据结构实验课(全部题目+完整代码
- 哈夫曼树实现图片压缩与解压
- 车辆保险管理系统
- 算法导论第三版英文原版
- CTP接口及开发文档.zip
- xxtea加解密工具win32
- VxWorks及Tornado集成开发环境的使用
- 炫彩界面库帮助文档chm-v2.5.0
- vc实用教程第三版+郑阿奇
- 嵌入式华清远见培训 ARM代码内部资料
- VLD For VS2019
- 网上鲜花销售系统完整代码
- Qt中嵌入Excel
- VS2010写的连连看
- Cocos2dx游戏源代码《萝莉快跑》
- Clion+Qt 运行的
- 超市进销存管理系统需要数据库
- 一维信号的小波变换算法.rar
评论
共有 条评论