tags:

views:

33

answers:

1

Hi everyone

I just developed a game using Cocos2D,it is so easy to move an object on the screen using Cocos such as MoveTo. But what about in Cocoa? How can I make an object move from point A to point B easily? Could anyone help? I really appreciate any helps. This is the code i used to make an object move in Cocos. How can I convert this to Cocoa, I mean the way to make a thing move in Cocoa.

Sprite *logo  = [Sprite spriteWithFile:@"logo.png"];
        logo.position = CGPointMake (240 , -10);
[self addChild:logo];
id actionTo = [MoveTo actionWithDuration:1.0f position:ccp(240, 55)];

            [sexyTrainning runAction:actionTo];
A: 

Depends on what kind of object you want to move.
Using Core Animation you could move a CALayer along an arbitrary path using the path property of CAKeyframeAnimation

More examples here.

weichsel