Hi, when I was debugging code for Animation. I found a bug in RepeatForever. Here is the code snap:
void RepeatForever::step(float dt)
{
_innerAction->step(dt);
if (_innerAction->isDone())
{
float diff = _innerAction->getElapsed() - _innerAction->getDuration();
_innerAction->startWithTarget(_target);
// to prevent jerk. issue #390, 1247
_innerAction->step(0.0f);
_innerAction->step(diff);
}
}
However, if this is a super large dt, the diff will be larger than _innerAction->getDuration(). So there could be a freeze time here.
It is better to use
float diff = fmodf(_innerAction->getElapsed(), _innerAction->getDuration())
instead.
Any ideas about this? It you agree, I will fix it like this.
Thanks
--
You received this message because you are subscribed to the Google Groups "cocos2d JS development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cocos2d-js-dev...@googlegroups.com.
To post to this group, send email to cocos2d-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.