Currently arcade physics engine has body.setMaxVelocity(x, y) to limit velocity in x and y part separated.
For example, body.setMaxVelocity(200)
200. 282.8427.... How about adding body.setMaxSpeed(speed) to limit the speed (vector length of velocity) in a steady value?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Yeah, worth adding at some point I think.
Set MaxVelocity will also limit the final angle of moving direction when speed-up continuously.
For example, asteroids movement, moving direction of ship will become 45/135/225/315 degrees (maxVelocity is (200,200) here) if initial angle of ship is not 0.
Is someone working on this feature? If not, I'd like to try to do this.
Thanks for opening this issue, and for submitting a PR to add it @Edwin222 . We have merged your PR into the master branch and attributed the work to you in the Change Log. If you need to tweak the code for whatever reason please submit a new PR.
Most helpful comment
Yeah, worth adding at some point I think.