Jump to content

Moving diagonally at the same speed as horizontal/vertical


Rissk13
 Share

Recommended Posts

I'm trying to figure out the equivalent of this code (Arcade physics) for Matter physics.

this.player.body.velocity.normalize().scale(this.player.speed);

The goal being to make the player move diagonally at the same speed as only moving either horizontal/vertical. Right now it seems a little faster when setting the velocity X and Y to 3.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...