Whats the different between MoveTo and MoveBy?

I am newbie to cocos. I try to execute the following code. What’s the different between MoveTo and MoveBy both actions are executed in the same way?


    var sprite_animation = cc.MoveTo.create(10,cc.p(100, 100));
    sprite.runAction(sprite_animation);

    var sprite_animation = cc.MoveBy(10, cc.p(100, 100));
    sprite.runAction(sprite_animation);

http://www.cocos2d-x.org/programmersguide/4/#by-and-to-what-is-the-difference

3 Likes

moveTo moves the sprite to a certain point (x,y)
MoveBy moves the sprite by point (∆x, ∆y)

2 Likes