catapult effect in cocos2d
How to catapult animation in cocos2d. Iam doing开发者_StackOverflow社区 animation of streching stick like rubber, does not get any luck yet, anyone knows please help.
Thank You.
It's hard to answer your question without more specifics. For instance, are you using one of the physics libraries (Box2D, Chipmunk) or are you rolling your own physics? Are you just trying to model a launched projectile (which is a simple parabola), or do you need to model the physics that actually launches the projectile (which will require a much more detailed model)?
If it's the former, as I said, the animation will just follow the arc of a parabola, but rather than computing the parabolic equation, it's probably easier to animate if you just give the projectile a velocity vector, and apply a gravity vector to it over time.
If it's the latter, I think you need to translate what you want into the physics involved. You mention a catapult, which is about levers, but then you mention a "stretching stick like rubber" which sounds more like spring forces, so the answer to your question is going to depend heavily on what exactly you're trying to achieve.
精彩评论