Skip to content

Is this an action speed bug? #1816

Open
@wuxiaomo6174

Description

@wuxiaomo6174

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);

},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions