 Thread: How many steps does it take?

1. How many steps does it take?

Hi
I Have a Ball Object wich is affected by Gravity ( and only Gravity ).
What i want is to find an expression wich will tell me the number of steps it takes ( how many times Gravity_ has to be applied ) before the Ball reaches the bottom of the Screen ( Y = 480 ).

...
FOR CONSTANT GRAVITY, THIS IS EASY
'Distance from Bottom Of Screen'/ Gravity_ = Number of steps.

EXAMPLE
Ball Ypos = 473
Gravity = 2

7/ 2 = 3,5

This example is not very complicated, and we can easily tell that this method is accurate and correct ( 473 + ( 2 * 3.5 ) = 480 ).

...
FOR NON CONSTANT GRAVITY, NOT SO MUCH
This is how Gravity works in my case ( im guessing its exponential? ):

- Every Frame
--> Add 1 to Gravity_
--> Ball set Ypos to Ball Ypos + Gravity_

How can i make an expression wich will let me know the number of steps it takes before the Ball reaches the bottom of the Screen ( Y = 480 ) in this case?  Reply With Quote

2. You're probably going to confuse a lot of people by using the wrong terms. When you say "gravity" you're actually talking about velocity. The "1" that you add to velocity each frame is acceleration due to gravity.

If the ball has an initial velocity of zero:
T = Ceil((Sqr((8*Y)+1)-1)/2)

If the ball's initial velocity > 0, then you should have said that in the first place - and you're out of luck anyway :P  Reply With Quote

3. Thank you very much MuddyMole! The equation works with perfect decimal precision ( when removing Ceil ) when i put it intoo MMF2!

However if i change the GravityForce ( the constant force that accelerates Yvelocity ) from 1 to any other number, the system breaks. I have tried inserting the Acceleration Force in different ways in the equation without luck.

...
Im sorry for any confusion i may have caused, and if i could edit the post i would.
Ill be sure not to repeat the misstake.

...
Ive been askin a series of these Equation Prediction Questions ( here on the Forum ) as part questions to a main problem, in hope that i will be able to understan how it all fits together. I do learn bits and pieces here and there, but its generally giving me a hard time. I really hate to ask these kinds of questions, since i hate to depend on someone else and have others 'do my work for me'.
I really wish i were able to set up and understand these equations by myself, but i dont even know where to beginn.   Reply With Quote Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•