1
\$\begingroup\$

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?

\$\endgroup\$
1
2
\$\begingroup\$

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));
\$\endgroup\$
1
  • \$\begingroup\$ Is it possible to do it using javascript? \$\endgroup\$ – Sasivarnan Aug 21 '17 at 7:46
0
\$\begingroup\$

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]];
\$\endgroup\$
1
  • 1
    \$\begingroup\$ 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. \$\endgroup\$ – MichaelHouse May 22 '13 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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