Hi everyone, I have a problem with animation of the road. The road sprite is initialized by a log picture of the road which goes left while the program works. But then the picture ends and I have to start moving it from the beginning, and I did it, but the animation twitches and the return to the beginning is noticeable. I don’to know if there is the way to do it smoothly.
The road moves this way (in function Update()):
if ((road->getPositionX() - coefSpeed * delta) <= origin.x) road->setPosition(Vec2(visibleSize.width / 2 + origin.x, visibleSize.height / 4 + origin.y)); else road->setPositionX(road->getPositionX() - coefSpeed *delta);
Class Action and Cocos Creator are avoid to use, unfortunately.