1

I'm making a game to spot the differences between 2 images. now i want to create a class 'Circle : CCSprite' to indicate the correct spot. I want to add a 'bouncing Effect' to the Circle(Just like iphone's warning modal window) I manually create CCActions, but the result is not as natural (since it's hard to control the duration and scale amount). Is there any better way to do this?

here is my code:

id up1 =[CCScaleBy actionWithDuration:0.2f scale:1.5f];
id down1 = [CCScaleBy actionWithDuration:0.2f scale:1 / 1.5f];
id up2 = [CCScaleBy actionWithDuration: 0.2f scale: 1.25f];
id down2 = [CCScaleBy actionWithDuration: 0.2f scale 1 / 1.25f];
id up3 = [CCScaleBy actionWithDuration: 0.2f scale 1.1f];
id down3 = [CCScaleBy actionWithDuration: 0.2f scale 1 / 1.1f];
[self runAction:[CCSequence actions:up1, down1, up2, down2, up3, down3, nil]];
OMGPOP
  • 1,995
  • 8
  • 52
  • 95

2 Answers2

3

Use the bounce or elastic easing methods built into Cocos2d. Google Cocos2d ease actions.

Mubeen Iqbal
  • 188
  • 3
  • 12
Simon Lee
  • 22,304
  • 4
  • 41
  • 45
  • Hey, i've tried several times. but still no idea how to set up the time and scale amt. and how many up/down pairs should i use? – OMGPOP Jun 11 '11 at 10:32
0

You can use CoreImage.

http://developer.apple.com/library/mac/#documentation/graphicsimaging/Conceptual/CoreImaging/ci_tasks/ci_tasks.html#//apple_ref/doc/uid/TP30001185-CH203-TPXREF101

Naveen Thunga
  • 3,675
  • 2
  • 24
  • 31