How can I make a ball move faster or slower depending on user input values?
Wauw you are vague!
How does the ball move? ActionScript / Tween ? If AS: What AS ? And what kind of input values do you want?
The ball moves vertically up from position 160 to 20 in a straight line. I want it to move faster or slower if the user inputs a value from 1 to 25, 1 being the slowest and 25 fastest. I want to use AS 2.0 and dont know if I can do it with tween. Thanks.
Something like this?
(Please be a little more specific next time!)
Actually the ball should stop at position 20 rather than bouncing. The user puts a value (1 to 25) , presses a button, and the ball moves from position 180 with designated speed. Thanks again.
Well you can simply have something like this (in order to get constant speed, and not any kind of acceleration)
myBall += userInput / ratio
Where ratio determines the amount of deviation in speed (for user input values from 1 to 25)
Does it make sense? You can remove the ratio for now, but later you’ll realize that you need it.