How can I make an animation have a consistent speed rather than duration? #1553
Unanswered
trevorwrightdev
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am making a JS game where the player moves to the location that you click on. But right now, the only way I can adjust the speed of the player movement is by setting the duration of the animation. This isn't good because I don't want every distance travelled to take up the same duration. I want it to be based on velocity and distance. For example, traveling 50 pixels in distance should take one fourth of the time to travel 200 pixels in distance. Here is my current code for the animation:
Is there a way I can change this to make it do what I want? I tried using inertia animations but the player would move in a strange direction when that was the case. I also want no bouncing or anything like that. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions