Question

I never developed in Cocos2D. However, this animated app is not easy to make with regular UIView animation and CAAnimation.

I want a number of UIImageView's (from 1 to 30) to float around the screen with the certain path and I want them to be responsive for touch (they would do some animation when touched). I also need them to go back and forth the screen (new path would be calculated) when they are touched or reach the edge of screen. It's important to retrieve X and Y position of each element whenever needed.

Question is: what Cocos2D classes are best looking at (for a beginner) to make that happen? I've tried UIView animation and CAAnimation but I came across some difficulties so I have a feeling Cocos2D may bring better results. Thank you.

Was it helpful?

Solution

Yes, cocos2d makes it much easier. You want to create a CCSprite with the initWithFile: method. Example:

CCSprite *mySprite = [CCSprite initWithFile:@"fire.png"];
[self addChild:mySprite];

Where fire.png has been added to the project and self is the scene instance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top