moveToTarget:function(){
var preDir=this.changeDir;
this.curStep++;
var dir=this.changeDir;
var next=this.curStep;
if(next>=this.wayTiles.length){
this.moveEndAttack();
this.moveOut();
//console.log("move out");
return;
}
//方向变化
if(preDir!=dir){
this.sprite.stopAllActions();
var animation1 = cc.Animation.create(this.dirAnim, 0.2);
var animate1 = cc.Animate.create(animation1);
//var action = cc.ScaleBy.create(0.2, 0.5);
this.sprite.runAction(cc.RepeatForever.create(animate1));
//
//
}
var curPoint=cc.p(this.wayTiles.x+40,this.wayTiles.y+80);
var moveTo= cc.MoveTo.create(this.speed, curPoint);
var nextMove=cc.CallFunc.create(this.moveToTarget, this);
var moveSeq=cc.Sequence.create(moveTo,nextMove);
this.runAction(moveSeq) ;
},
这里:
var animation1 = cc.Animation.create(this.dirAnim, 0.2);
var animate1 = cc.Animate.create(animation1);
//var action = cc.ScaleBy.create(0.2, 0.5);
this.sprite.runAction(cc.RepeatForever.create(animate1));
在jsb下有问题,在web下没问题