else if(keyCode==39){
target.setPositionX((target.getPositionX()+3));
var animation=new cc.Animation.create();
for(var i=2;i<4;i++){
var frameName="res/small_Man/walk_"+i+".png";
animation.addSpriteFrameWithFile(frameName);
cc.animationCache.removeAnimation(animation);
}
animation.setDelayPerUnit(0.15);
animation.setRestoreOriginalFrame(true);
target.runAction(cc.repeatForever(cc.animate(animation)));
}
```
我获取键盘的右方向键,按下去就播放人物向右走动的动画,但是一直按着右方向键,帧动画跑 太快了,都看不清每一帧,咋个解决啊,本人新手学这个
:904: :904: :904: :904: :904: :904: :904: :904: :904:

为什么没人能给个提示啊,咋没人啊


你应该用scheduler,在update函数里做target.setPositionX((target.getPositionX()+3));这种操作,大概意思是这样的:
if(keyCode==39){
this.goright = true;
//other things...
}
....
update:function(){
if(this.goright)
this.x += 3;
}
```
谢谢大神啊,万分感谢啊,小弟初学多有不懂,谢谢教导啊:867::867::867:,太感谢了