Hi! Can anyone help me on this? I want to drag an object from a platform to a hight and calculate that high as the distance traveled when free falling from that hight to ground... I use a stopwatch for calculating the time and want to confirm the equation h=1/2gt^2
on drag start save the current Y (tempY)
on drag drop calculate (tempY - current Y)
Thank you but i don't meen that exactly. The distance i find with this calculation is not the distanse travelled on free fall (y=1/2gt^2). As you see h is different from y. I want them to be equal when object hits ground. I include the .capx file to help.
https://drive.google.com/file/d/0Byb2YP ... sp=sharing
Develop games in your browser. Powerful, performant & highly capable.
Sorry, i don't have the needed plugin...
You have to be more specific with your idea to understand your problem...
I have an object on object.Y = 400. I drag that object to object.Y = 50. The distance is 350 ( I don't change the object.X). Then I drop the object and let it do a free fall to object.Y = 400 again. Based on constant timer (every tick add dt to timer) I calculate the fall distance as y=(1/2)*10*timer*timer. How can I match this distances?
You are assuming you know the number that C2 actually uses for G. Doing an experiment to reverse engineer the number, comes up with a factor of 4.7 for your simulation. Also, your starting coordinate is not 470, the center of the sprite is 459, so that is your distance reference.
Great!!! Thank you for your help!!!