This script is an effort to apply some simple physics simulation in PyGame. Please credit the source if you make use of this code.
An object (a square sprite) is created and placed into a running
PyGame environment. The object behaves as if it is under the influence of
gravity (somewhat like a tennis ball).
Download this script.
Proper collision detection is added, including path based collisions.
You can use the mouse to pick the object up and move it around the
environment. The simulated object moves in both the vertical and horizontal axes.
Collisions are completely elastic in this version.
There is a known bug with lost velocity on a small number of collisions
Download this script.
This version represents a major redesign of code, with several major bugs rectified.
Multiple dynamic sprites are now modeled with proper collisions between them. The
Internal code documentation has been improved and code has been seperated into library
code and application code.
There is a known major bug with dragging sprites with the left mouse button (to be
corrected in the next release)
Download this library and sample application