However, when I changed the code to CCJumpTo, it didn’t work as expected. The jump was done well for the first time, but after that it started jumping toward the right of the screen.
CCJumpTo* jump;
jump = CCJumpTo::create, 300, 1);
CCRepeatForever* repeatJump = CCRepeatForever::create;
seeker~~>runAction(repeatJump);
Could anyone help clarify this problem for me? Did I implement anything wrong? or is it a cocos2dx bug? (I’ve searched on the internet and found some topic regarding this issue, but those were posted a year ago. So i dunno whether the bug still exists, or it is just a coding error.)
CCJumpBy will make the object jump BY X pixels to the left or right and Y pixels above or below. CCJumpTo will make the object jump TO the indicated location.