# ummm, I have a Question

This topic is 4678 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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 .

##### Share on other sites
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.

##### Share on other sites
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;

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 12
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632991
• Total Posts
3009752
• ### Who's Online (See full list)

There are no registered users currently online

×