need help in understanding CCMoveTo?
I have downloaded the sample demo and trying to understand it.but Stuck on following code
id actionMove = [CCMoveTo actionWithDuration:actualDuration position:ccp(-target.contentSize.width/2, actualY)];
id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)];
[target runAction:[CCSequence actions:actionMove, actionMoveDone, nil]];
How CCMoveTo
moves object from one location to another as thi开发者_开发百科s object moves from left to right.
How CCMoveTo
moves object from one location to another as this object moves from left to right.
not like left to right?
If the object(sprites) anywhere and you are willing to moveto some position from current position
example
current sprite position
(100,100)
then if you use CCMoveTo
with (200,200) then it will move to (200,200)
then if you use CCMoveBy
with (200,200) then it will move to
currentposition+neededposition
so (100+200,100,200) which implies (300,300);
精彩评论