# Collision and gravity problems

So this is an easy question. I need to implement gravity in my game but where I'm stuck is what variables do I need in my Entity object for the calculations and a good algorithm that I can use for gravity and collision. The main reason why I'm stuck here is not just I'm implementing this into a huge program that handles the different states, windows, buttons and plenty of other stuff but all I got it the x, y, width, and height for my Entity and every time I try and calculate collision if the object hits a wall it stops, and I have no acceleration variables as I don't know how to use a algorithm with them so I'm guessing as I go and so my whole program is a mess. To make it clear of what I need someone to help me with is can you show me an example of how I would use my x, y, height, and width and move it around, use jumping, use gravity. I never really saw any of this so if someone knows how to do this, and or you have done this is a game before which you could show me what you did that would be great. I'm new to this so even a link is good. Thanks in advance!

-
What is the question? Are you asking us to implement game engine for you? What is "your x, y, height, width" ? What is "your Entity" ? – Ivan Kuckir Mar 29 '13 at 13:52
The x and y are the position, and the width and height is how big the object is. A entity has x, y, width, height, and is considered a in game object that represents something like a AI or the player. – LiquidFeline Mar 30 '13 at 2:17