资源简介
简单炸弹人小游戏源码,coco2d-x 3.2

代码片段和文件信息
#include “AnimationManager.h“
#include “constant.h“
using namespace cocos2d;
static char charBuffer[128];
bool AnimationManager::loadAnimation(AnimationFormation *afint count)
{
//缓冲——这会加载对应的png,并裁切成Spriteframe,而且还会完成索引
sprintf(charBuffer“%s.plist“af[0].animateName);
//预加载精灵图片
SpriteframeCache::sharedSpriteframeCache()->addSpriteframesWithFile(charBuffer);
//获取纹理缓存
SpriteframeCache *spriteframeCache = SpriteframeCache::sharedSpriteframeCache();
for (int i = 0; i < count; i++)
{
Vectorame *> actionArry;
for(int j = 0; j < af[i].frameNum; j++)
{
sprintf(charBuffer“%s_%s%s%d.png“ af[i].animateName getBehaviour(af[i].behaviour) getDirection(af[i].direction) j);
Spriteframe *spriteframe = spriteframeCache->getSpriteframeByName(charBuffer);
if (spriteframe != NULL)
{
actionArry.pushBack(spriteframe);
}
}
//使用cache缓冲管理
Animation *animation = Animation::createWithSpriteframes(actionArry 0.3f);
sprintf(charBuffer“%s_%s%s“ af[i].animateName getBehaviour(af[i].behaviour) getDirection(af[i].direction));
AnimationCache::getInstance()->addAnimation(animation charBuffer);
}
return true;
}
Animate* AnimationManager::getAnimate(char *name Behaviour behaviour Direction direction)
{
std::string aniname = getAnimationName(name behaviour direction);
Animation* animation = AnimationCache::getInstance()->getAnimation(aniname);
if (animation == NULL)
{
return NULL;
}
return Animate::create(animation);
}
char* AnimationManager::getAnimationName(char *name Behaviour behaviour Direction direction)
{
memset(charBuffer0sizeof(charBuffer));
sprintf(charBuffer“%s_%s%s“name getBehaviour(behaviour) getDirection(direction));
return charBuffer;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-10-27 10:48 Classes\
文件 1862 2014-10-27 17:48 Classes\AnimationManager.cpp
文件 481 2014-10-27 16:51 Classes\AnimationManager.h
文件 1178 2014-10-27 18:36 Classes\AppDelegate.cpp
文件 992 2014-10-27 10:53 Classes\AppDelegate.h
文件 2238 2014-10-27 18:08 Classes\Bomb.cpp
文件 474 2014-10-27 12:02 Classes\Bomb.h
文件 528 2014-10-27 18:16 Classes\constant.cpp
文件 259 2012-01-09 19:50 Classes\constant.h
文件 3282 2014-10-27 18:14 Classes\GameMediator.cpp
文件 897 2012-01-10 17:54 Classes\GameMediator.h
文件 1426 2014-10-27 18:18 Classes\GameOverScene.cpp
文件 335 2014-10-27 18:17 Classes\GameOverScene.h
文件 4283 2014-10-28 18:06 Classes\GameScene.cpp
文件 681 2014-10-27 16:35 Classes\GameScene.h
文件 1817 2014-10-27 18:18 Classes\HelpScene.cpp
文件 472 2014-10-27 16:20 Classes\HelpScene.h
文件 3948 2014-10-28 18:03 Classes\Hero.cpp
文件 723 2014-10-28 11:54 Classes\Hero.h
文件 2783 2014-10-27 18:08 Classes\Monster.cpp
文件 597 2014-10-27 13:46 Classes\Monster.h
文件 504 2012-01-08 17:33 Classes\Singleton.h
文件 1041 2014-10-27 18:28 Classes\TileMap.cpp
文件 410 2012-01-10 15:58 Classes\TileMap.h
文件 2017 2014-10-27 16:32 Classes\ti
文件 546 2014-10-27 16:29 Classes\ti
文件 918 2014-10-27 15:48 Classes\tools.cpp
文件 610 2014-10-27 11:16 Classes\tools.h
文件 425 2012-01-08 17:13 Classes\type.cpp
文件 454 2014-10-28 15:25 Classes\type.h
目录 0 2014-10-27 18:09 Resources\
............此处省略14个文件信息
- 上一篇:二维模型粘弹性人工边界在ansys中的应用
- 下一篇:考研机试题库 编程
相关资源
- 海康威视 WEB无插件开发包 V3.2
- 安国AU6989SN/SNL系列最新量产工具V16.
-
li
nksys AE1000/Cisco AM10无线网卡驱动 - 清华同方手写板万能驱动程序
- windows3.2简体中文版,虚拟机文件
- 康源建站系统最新版本V3.2
- cocos2d-x飞机大战项目
- BLE-CC254x-1.3.2 蓝牙官方源代码
- Freemarker 2.3.23 最新中文版参考手册
- 创新SoundBlaster系列声卡ALchemy炼金术辅
- Delphi KOLMCK V3.23最新版
- 戴尔d630无线网卡驱动 v1.3.2 官方最新
- 使用ATLAS探测器在3.2 fbâ1的质子
- Cocos2d-x开发游戏的坐标系知识介绍
- Apabi Reader 3.2打印成PDF软件
- Cocos2d-x 3.x 头像选择器功能扩展Image
- DELL戴尔灵越Inspiron 5520触摸板驱动程序
- 硬盘安装工具 CGI 3.2多核心,纯净且功
- 基金投资管理系统O3.2用户手册(V1.
- 交通信号灯_PLC_V1.3.20200724.1.xdp
- 光汇科技V3.27单片机开发板电路图
- Iris-0.9.3.2破解版
- 林智仁教授最新版本LibSVM工具箱
- 余闻同学录3.2b4破解版完美去后门版源
- 节奏大师源码
- 天音淘宝店铺宝贝批量复制大师V3.2
- libsvm-3.20
- nexus-3.27.0-03包含windows和linux
- FC炸弹人I图片素材.rar
- PRTG Network Monitor 17.3.33.2753含破解 最好
评论
共有 条评论