How to make cocos2d sprite scale up and down (for a pulsating effect) every second?
问题 I want to have a sprite scale up and down once every second to make it seem like it is bulging and pulsating. How can I do this? 回答1: As the post before contains syntax errors. To be more precise, I post working code: CCSprite * sprite = ...; // create the sprite. id scaleUpAction = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:1 scaleX:1.0 scaleY:1.0] rate:2.0]; id scaleDownAction = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:0.5 scaleX:0.8 scaleY:0.8] rate:2.0]