Example:
id jump = [JumpBy actionWithDuration:3 position:cpv(400,0)The old action Repeat is still present in v0.6. In fact, it includes some fixes. Now it is possible to Repeat a Sequence of Repeat of Sequences of Repeat... but you can't use it to repeat an action forever.
height:50 jumps:4];
[node do: [RepeatForever actionWithAction:
[Sequence actions: jump, [jump reverse], nil]
]
];
Repeat as well as Sequence are IntervalAction actions. This means that they occur during a certain period of time: they start and they stop. You can accelerate, or change the speed of any any IntervalAction using the Accelerate, AccelDeccel and Speed actions, but if an action is executed forever, then it is not an IntervalAction.
This means that:
- You can Repeat a Sequence of Repeat of Accelerate of Sequence of Repeat of Speed of Sequence...
- You can't Sequence a RepeatForever action since Sequence only works with IntervalActions. Again: RepeatForever is not an IntervalAction since it hasn't an stopping time.
- But you can RepeatForever a Sequence of Repeat of Sequence of... Note that the RepeatForever is executed first.
2 comments:
Hi! I'm very new to IPhone game programming. I need help for how to bounce a ball using Chipmunk. For example if I hit a ball, the ball will touch any one of four sides of space and will bounce just like using a striker in Carom board game. I got a source example called Grabbed_src (http://code.google.com/feeds/p/grabbed/downloads/basic) which used Cosco2d & Chipmunk.
This example helped me a lot but with only obstacle that is use of GRAVITY. In this example gravity is applied for only one side of space say bottom. I need help for ‘HOW TO APPLY GRAVITY FOR FOUR SIDES OF SPACE SO THAT A BALL CAN BOUNCE AFTER TOUCHING ANYONE OF FOUR SIDES OF SPACE.
I’m running in very short time frame! Help me out please...
Thanks
Shafi
shafijami@yahoo.com
shafi@icreon.com
Shafi,
consider asking this question in the cocos2d discussion group:
http://groups.google.com/group/cocos2d-iphone-discuss
Post a Comment