Friday, 12 July 2013

cocos2d breathing effect and animate up and down on a Sprite



id Item1Down= [CCMoveBy actionWithDuration:2.5 position:ccp(0,-15)];
id Item1Up= [CCMoveBy actionWithDuration:2.5 position:ccp(0,+15)];
id easeDown1 = [CCEaseInOut actionWithAction: Item1Down rate:2];
id easeDown2 = [CCEaseInOut actionWithAction: Item1Up rate:2];
id sequence = [CCSequence actionOne: easeDown1 two: easeDown2];

[yourSprite runAction:[CCRepeatForever actionWithAction: sequence]];