A simple Processing demo using the PPhys2D Library.
czech it out. :D
Quote:Controls: Arrow Keys: Move the blue box. Shift + Arrow Keys: Boost. Mouse Click: Create a randomly colored box. Size is a random number between 5 and the value of the 'Max Box Size' slider. Space: Set the location of the blue box to where the mouse is. Useful if the box goes off the screen. (Note: The box's velocity is unchanged. If it's moving fast, it'll be moving fast when it appears at the mouse coordinates.) R: Resets all the sliders to their default value.
Sliders:
Gravity: Pretty self explanatory. Positive values, stuff goes down, negative, stuff goes up, zero, stuff floats around. Shift Force: Determines the amount of the boost. Max Box Size: Determines the max of the randomly generated numbers to get the size of new boxes. Friction: A higher friction means that touching bodies will loose energy, and will result in a "sticky" effect. Restitution: Set the restitution of the edges, which define itself by the "spring" effect occurring when two bodies. A value of 1 would be a pool ball. The default is 0, which mean no restitution. Damping: Damping is the effect of "air" on a body. The more damping you have, the more energy lost you will get, resulting in an impression resistance to the gravity effect. Use this function to adjust the damping of all bodies, wich will make it fall faster or slower.