Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am working on a card game and would like to ask if someone could advice me how to implement a flip of a card in Cocos2D?

share|improve this question
    
found a possible solution: cocos2d-iphone.org/forum/topic/15771 –  PeterK Nov 30 '11 at 22:43
add comment

2 Answers

Flip animation in cocos2d-android-1 like that...

CCSprite sprite=CCSprite.sprite("icon.png");
CCIntervalAction a = (CCIntervalAction)CCOrbitCamera.action(2, 1, 0, 0, 360, 0, 0);
addChild(sprite,1);
sprite.runAction(CCRepeatForever.action(a));
share|improve this answer
add comment

ios objective-c version:

CGSize winSize = [CCDirector sharedDirector].winSize;
CCSprite *player = [CCSprite spriteWithFile:@"Games1.png"];

player.position = ccp(player.contentSize.width/2, winSize.height/2);

CCActionInterval *a = [CCOrbitCamera actionWithDuration:2 radius:1 deltaRadius:0 angleZ:0 deltaAngleZ:360 angleX:0 deltaAngleX:0];
[self addChild:player];
[player runAction:[CCRepeatForever actionWithAction:a]];
share|improve this answer
1  
Answers that are just code without explanation are poor answers. They're not very good because they don't do much to help users learn. –  Byte56 May 22 '13 at 19:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.