how to achieve smooth movement of a sprite with keyboard control? #1822
Unanswered
10100010010001001010
asked this question in
Q&A
Replies: 1 comment
-
Try stopping the previous move action before running a new one. The issue may be that onKeyPressed is constantly called, so you're just adding more and more actions to the same node. What you actually want is to simply move it from its current position by an amount to the new position, so you need to cancel the current action on the node before applying the new action. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I needed to make keyboard controls, but I discovered that simply moving the sprite by some value is essentially teleportation and there is no smooth movement. What would you do in this case?
So far I've implemented it like this:
Beta Was this translation helpful? Give feedback.
All reactions