//方式一铜涉,通過多張圖片來創(chuàng)建??
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);??
//創(chuàng)建幀動(dòng)畫序列,名詞形式??
var?animation?=?new?cc.Animation();??
for?(var?i?=?1;?i?<=?4;?i++)??
???????{??
animation.addSpriteFrameWithFile("res/player_animation/action"+?i?+".png");??
???????}??
//設(shè)置幀動(dòng)畫屬性??
var animation = new cc.Animation()
animation.addSpriteFrameWithFile(res.water01)
?animation.addSpriteFrameWithFile(res.water02)
animation.addSpriteFrameWithFile(res.water03)
animation.setDelayPerUnit(2.0 / 4)// 每一幀停留的時(shí)間
?animation.setRestoreOriginalFrame(false) // 播放完后回到第一幀
?var animate = new cc.Animate(animation)
this.dragon.runAction(new?cc.RepeatForever(animate));??