资源简介
cocos2dx 3.17 写的2048游戏,开发语言是C++,使用windows10+VS2017开发,楼主测试可以编译安卓apk,只上传了class和resource文件夹,大家自己新建个项目添加进去吧。
已知bug:
连续快速移动方块数字会变大,正常使用不会,应该是动画没做判断
代码片段和文件信息
/****************************************************************************
Copyright (c) 2017-2018 Xiamen Yaji Software Co. Ltd.
http://www.cocos2d-x.org
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include “AppDelegate.h“
#include “HelloWorldScene.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);
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: redgreenbluealphadepthstencilmultisamplesCount
GLContextAttrs glContextAttrs = {8 8 8 8 24 8 0};
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_PLATFO
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5743 2018-07-02 23:40 Classes\AppDelegate.cpp
文件 2225 2018-07-02 09:19 Classes\AppDelegate.h
文件 3567 2018-07-02 23:42 Classes\Card.cpp
文件 819 2018-07-02 22:50 Classes\Card.h
文件 14114 2018-07-19 16:35 Classes\HelloWorldScene.cpp
文件 2898 2018-07-19 14:52 Classes\HelloWorldScene.h
文件 5400 2018-07-18 09:57 Classes\MyMsgBox.cpp
文件 1792 2018-07-19 09:37 Classes\MyMsgBox.h
文件 586 2018-07-19 09:25 Classes\RecordManager.cpp
文件 258 2018-07-19 09:25 Classes\RecordManager.h
文件 729 2018-07-02 20:36 Classes\StringManager.cpp
文件 386 2018-07-02 20:16 Classes\StringManager.h
文件 3596 2018-07-02 09:19 Resources\CloseNormal.png
文件 2810 2018-07-02 09:19 Resources\CloseSelected.png
文件 778552 2018-07-02 09:19 Resources\fonts\arial.ttf
文件 25776 2018-07-02 09:19 Resources\fonts\Marker Felt.ttf
文件 37864 2018-07-02 09:19 Resources\HelloWorld.png
文件 3890 2018-06-20 16:48 Resources\music\effect\move.mp3
文件 1566 2018-07-02 16:04 Resources\pic\btn\msgbk.png
文件 2871 2018-07-17 20:26 Resources\pic\btn\msgcancel.png
文件 2492 2018-07-17 20:26 Resources\pic\btn\msgno.png
文件 2786 2018-07-17 20:26 Resources\pic\btn\msgok.png
文件 0 2018-07-02 09:19 Resources\res\.gitkeep
文件 151 2018-07-02 20:39 Resources\string\string.xm
目录 0 2018-07-02 11:33 Resources\music\effect
目录 0 2018-07-19 09:35 Resources\pic\btn
目录 0 2018-07-02 09:19 Resources\fonts
目录 0 2018-07-02 11:33 Resources\music
目录 0 2018-07-02 16:04 Resources\pic
目录 0 2018-07-02 09:19 Resources\res
............此处省略6个文件信息
- 上一篇:计算机组成原理booth算法C源码
- 下一篇:打印出有向图中的所有环C++
相关资源
- 打印出有向图中的所有环C++
- C++中缀表达式求值
- 一个数字水印的VC++源程序,支持图片
- C++大学教程(第七版)](美)戴特尔
- Visual C++串口通信
- 蜘蛛纸牌VC++
- k-means 源代码C++实现
- QTP 运行报:Microslft Visual C++ Runtime Lib
- A星算法,A*算法C++实现,8数码求解
- 个人账簿管理系统c++
- 单片空间后方交会c++
- C++ Prime中文版第五版
- VC++界面编程之 实现一个画板并提供
- VC++ WTL 9.0 安装包
- 激光雷达数据读取以及显示C++需配置
- 激光雷达UTM-30LX图像采集程序及数据
- horsematch 赛马程序游戏
- VC++ 内存扫描与内存数据读写.rar
- 16点基4dit-fft程序c++
- 排队论C++语言仿真实现
- c++面向对象程序设计 谭浩强第二版习
- 异步网络通信 用C++
- WAV文件的读写接口类,依赖标准C++库
- C++五子棋程序实验报告
- C++ 先进先出算法FIFO
- 画图程序最新版 MFC/VC/VC++ 很多功能哦
- 华中科技大学C++实验
- C++课设MFC实现人员信息管理系统
- 模拟船只航迹发生的VC++程序,是航船
- C++程序员简历模板
评论
共有 条评论