ummm, I have a Question

Started by
2 comments, last by erissian 18 years, 3 months ago
Ok, my question is a little different from the usual. What I have is a quarterback challenge game. In my game you just throw a football at recievers that are running routes. When you throw the football the ball travels to an invisible "x" which is where the receiver is headed. My problem is, the recievers have all different speeds and so sometimes the slow receivers don't make it to the "x" before the ball gets there. What I need have is the distance between the "x" and the receiver in proportion to the receiver's speed. Think you know?
Advertisement
I think what you want is how long it would take the reciever to get there. Velocity(speed and direction) = distance/time . Therefore time = distance/velocity .
you could move the x by the same velocity as the runner, except mult it by, lets say a float called 'diffX' so it's always ahead of him. then play around with it to see what value of 'diffX' gets the player to catch the ball most of the time. i'd imagine you wouldn't want it absolutly perferct because sometimes people fumble the ball, but that's just my assumption.

not very elegant, but whatever works.
Say the distance between the QB and X is called DQB.
Also, let the distance between the receiver and X be DR.
Lastly, the speed of the receiver is VR.

You need the speed of the quarterback's thrown ball to be such that the ball covers DQB in the same time it takes the receiver to cover DR.

So, to find that time:
T = DR / VR;

Then, to find the velocity of the ball, we divide the distance by that time:
VQB = DQB / T;

Or, in one step:
VQB = VR * DQB / DR;
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)

This topic is closed to new replies.

Advertisement