Memebers of this group:
You can download the code here
V i =Inital Velocity
a= accleration (which is a constant,and always 9.81 m/s2)
V f =Final Velocity
We start with the simple 2-d motion eqations
V f =V i+a*t
The way we execute our program is chunk by chunk. frame by frame
for every frame gravity is accounted for by using the equation above and keeping the time
from the previous frame to calculate velocity.
The position is determined by constantly updating both x and y coordinates
After all of this is updated, there is a check to determine whether or not it has
hit the ground or a wall.
If it has, then the velocity in the y direction is inverted, and reduced by its
If it has hit a wall, then the same is done, just to the x velocity.
You can e-mail me at:
ilami [at] usc.edu