iDevGames Forums
giving gravity and weight to object - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: giving gravity and weight to object (/thread-825.html)



giving gravity and weight to object - 9livesoftware - Aug 22, 2009 01:45 PM

Hello,
> I know this will be very hard to calaculate the weight and gravity but i was wondering if you could help. I have a cannon facing up and I have bombs that shot out of it going to where ever the user taps on the screen. I want the bombs to look like this when you tap. The "T" is where the user taps.
>
> http://parrish.homeip.net/public/example.png


giving gravity and weight to object - Elphaba - Aug 22, 2009 04:45 PM

Search Google for 'Gaffer On Games' => he has a physics / numerical integration series that will give you all the stuff you need.

Good luck.


giving gravity and weight to object - mikey - Aug 23, 2009 01:46 AM

From a physics point of view, keep in mind horizontal velocity and vertical velocity are seperate. So, for horizontal velocity, just move the x to the tap, and for vertical, move it to (tapY + powerOfCannon) initially then down until tapY == positionY. That will give you the path, the velocity should not be too difficult.