Reputation: 2018
How do you change the speed of an object in phaser without changing its direction? For example, I have a ball that collides against a moving platform. I want the ball to change direction, but not gain any additional speed from the collision against a moving side of the platform. Up to now I have had to take the sign of the velocities of the object and then reapply a constant value speed to it on collision, but that seems quite wrong for a library as robust as Phaser is.
How do you modify speed and direction independently outside of velocity?
Upvotes: 4
Views: 1231