I need move a sprite repeat forever, and I need do something between every step. So I using bellow code.
MoveBy *move = MoveBy::create(0.2, Point(16,0));
Sequence *seq = Sequence::create(move,
Action *moveAction = RepeatForever::create(seq);
Point pos = mSprite->getPosition();
log("current position[%f,%f]", pos.x, pos.y);
current position408.079895,136.000000current position425.767242,136.000000current position440.077759,136.000000
But the MoveBy action seems has deviation with repeatForever.
The position of mSprite should always move by offset(16,0), but there always a bit more or little.The deviation will intolerable as time elasped.
If I force set mSprite to the right position on oneStep function, the action stumbled…
Any suguesstion to solve this problem?