1
vote
Accepted
JS 2D top down movement doesn't act as expected
Your issue is that you're clamping the x and y components of the velocity independently. So once the x value hits 100, it saturates. Meanwhile, if the mouse is still above the object, the y value ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
movement × 975unity × 312
c# × 164
2d × 148
physics × 127
java × 75
rotation × 60
vector × 53
mathematics × 52
camera × 52
collision-detection × 48
c++ × 45
xna × 44
ai × 43
sprites × 38
libgdx × 37
javascript × 31
android × 30
rigidbody × 27
input × 26
3d × 25
path-finding × 25
animation × 24
character × 22
algorithm × 21