I am trying to generate a Card game in Cocos2d-Html5-v2.2.2. Now i am stuck on one card flipping task. Actually i want to make a flip effect from opened card to closed card.
var openCard = cc.Sprite.createWithSpriteFrameName('front_card.png'); openCard.setPosition(new cc.Point(200, 300)); openCard.setVisible(true); this.addChild(openCard); var closedCard = cc.Sprite.createWithSpriteFrameName('back_card.png'); closedCard.setPosition(new cc.Point(200, 300)); closedCard.setVisible(true); this.addChild(openCard); var closedFlip = cc.RotateBy.create(2, 0, -90); var closedCardOpenAction = cc.TargetedAction.create(closedCard, closedFlip.reverse()); openCard.runAction(cc.Sequence.create(closedFlip, closedCardOpenAction));
But it is not working perfectly .
Can anyone is able to help me on how to implement a Flip image rotation in Cocos2dHtml5 ?
Thanks & Regards,
Shiju T V