cocos2d-x实战项目开发:功夫小子之需求分析和开发准备-课程概要

时间:2022-03-28 23:03:56

cocos2d-x实战项目开发:功夫小子之需求分析和开发准备-课程概要
1. 游戏概要和分析
2. 项目设计分析
3. 开发环境的搭建和基本配置

游戏概要和分析
1. 游戏场景有什么
Splash场景
主界面及附属界面的场景
选关场景
游戏场景:正在游戏,游戏暂停,游戏结束
2. 游戏角色有哪些
英雄
怪物
3. 游戏规则和特点
横版
无摇杆
怪物分拨出现,打完结束

基本工具类的分析和实现-动画缓存和动画创建方法
涉及的相关函数和类
1. 动画帧SpriteFrame
2. 帧缓存SpriteFrameCache

动画创建的方法
1. 需要的参数:动画帧图片的名字,图片数量,帧时间间隔,循环次数
2.

Animate *ActionTool::animationWithFrameName(const char *each_name,int iloops,float delay)
{
SpriteFrame *frame=NULL:
Animation *animation=Animation::create();
int index=1;
do
{
String *name=String::createWithFormat("%s%d",each_name,index++);
frame=SpriteFrameCache::getInstance()->getSpriteFrameByName(name->getCString());
if(frame==NULL)
{
break;
}
animation->addSpriteFrame(frame);
}while(true);
animation->setDelayPerUnit(delay);
animation->setRestoreOriginalFrame(true);
Animate *animate=Animate::create(animation);
return animate;
}