Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this an action speed bug? #1816

Open
wuxiaomo6174 opened this issue Dec 10, 2015 · 1 comment
Open

Is this an action speed bug? #1816

wuxiaomo6174 opened this issue Dec 10, 2015 · 1 comment

Comments

@wuxiaomo6174
Copy link

I have an animation then want to dynamic control its speed with action speed.
But it is very strange that whatever i add or plus its speed, the animation always speed up.

here is the code:

var animationFrames = [];
for(var i=1;i!=8;i++){
    var path = typeName + i +'.png';
    var frame = cc.spriteFrameCache.getSpriteFrame(path);
    animationFrames.push(frame);
}
var animation = new cc.Animation(animationFrames,intervalTime);
var runningAction = new cc.animate(animation).repeatForever();
runningAction.retain();

here is the speedup function:

adjustRunningSpeed:function(x){
     var speedx =  this.runningAction.getSpeed();
     var finalSpeed = speedx + x;
     this.runningAction.setSpeed(finalSpeed);

},

@wuxiaomo6174
Copy link
Author

@pandamicro
Could you help have a look? Maybe it is a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant