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!
Not an entire answer, but a good tip: Add a bit to your entity called "falling" (or, inversely, "supported") which specifies whether or not gravity applies to the object. When an object is sitting on top of a stationary object you don't need to apply gravity effects to it, and you can set and unset that bit on events and collisions.