[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Make a sprite fall with realistic gravity?



g = -9.8m*s^-2.  Near the surface of Earth, this is usually thought of as a constant.  To make your object fall slower, simply decrease the magnitude of this constant.  Unless doing something that absolutely must be physically based (like for measuring something), I'd use "what looks right".

Because velocity is added in discrete elements at discrete intervals, the object's trajectory will have error.  If you really need the object to fall exactly, integrating acceleration twice wrt time gives the position equation x = -4.9*t^2.  The exact position of the object after the start frame is given by the position function, because position is calculated directly.

Ian