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?
1
-
\$\begingroup\$ found a possible solution: cocos2d-iphone.org/forum/topic/15771 \$\endgroup\$ – PeterK Nov 30 '11 at 22:43
Add a comment
|
\$\begingroup\$
\$\endgroup\$
1
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));
-
\$\begingroup\$ Is it possible to do it using
javascript
? \$\endgroup\$ – Sasivarnan Aug 21 '17 at 7:46
\$\begingroup\$
\$\endgroup\$
1
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]];
-
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