//方式一,通过多张图片来创建
this.dragon = new cc.Sprite("res/player_animation/action1.png");
this.dragon.setPosition(cc.p(cc.winSize.width*0.3, cc.winSize.height/2));
this.addChild(this.dragon);
//创建帧动画序列,名词形式
var animation = new cc.Animation();
for (var i = 1; i <= 4; i++)
{
animation.addSpriteFrameWithFile("res/player_animation/action"+ i +".png");
}
//设置帧动画属性
var animation = new cc.Animation()
animation.addSpriteFrameWithFile(res.water01)
animation.addSpriteFrameWithFile(res.water02)
animation.addSpriteFrameWithFile(res.water03)
animation.setDelayPerUnit(2.0 / 4)// 每一帧停留的时间
animation.setRestoreOriginalFrame(false) // 播放完后回到第一帧
var animate = new cc.Animate(animation)
this.dragon.runAction(new cc.RepeatForever(animate));