Possible Duplicate:
Tracking Object Position - Firing on a Trajectory
I need help in implementing the projectile motion in my game as was implemented in Angry Birds.
Please help.
I need help in implementing the projectile motion in my game as was implemented in Angry Birds. Please help. |
|||||
|
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
|
Projectile motion is just a function of gravity and velocity. At every tick, decrease your vertical velocity by For a more in depth look at the physics required in these sorts of games, Google around for some game development blogs or how-to's, or start with this one here. |
|||
|
|
|
Physics. Specifically look at http://en.wikipedia.org/wiki/Hooke's_law, http://en.wikipedia.org/wiki/Equations_of_motion and the application of a constant force of gravity. Obviously if you're not sure about how to apply these things together, perhaps look at implementing a Physics engine. |
|||
|
Here is some code for doing exactly what your ask for... http://developer.anscamobile.com/code/how-make-angry-birds-catapult It's written in Lua and uses the Corona SDK. But I'm sure you could port it over to whatever platform you are working on. |
|||
|
|
|
Just read this tutorial(its a series so go through all of them): http://www.emanueleferonato.com/2011/11/03/develop-a-flash-game-like-angry-birds-using-box2d-predictive-trajectory-line/ |
|||
|
|
|
You haven't told us what is the problem. Anyway, I guess you are asking how to do it. Here is a link. Implementing the equations is not hard at all. |
|||
|
|