3 ms·
Nice stuff. I noticed something slightly weird in the "Spaceship motion / With drag" example. Looking at the code it seems that drag is applied individually on
by vinkelhake 13y ago
Nice stuff. I noticed something slightly weird in the "Spaceship motion / With drag" example. Looking at the code it seems that drag is applied individually on the X and Y axis. If you rotate the ship just a little bit, gather some speed and then let go, the ship will have its horizontal speed zero out rather quickly and the ship will glide sideways until it comes to a halt in the vertical direction.
Can't write more now, need to go play with the other examples!
- al2o3cr 13y ago"drag" seems like a bit of a misnomer for what that parameter is doing - the effect on x and y velocity is calculated separately, so you're always going to get the little "twist" at the end when velocity on one axis drops below the drag value. See also the source here: https://github.com/photonstorm/phaser/blob/master/src/physics/arcade/World.js#L265 https://github.com/photonstorm/phaser/blob/master/src/physic... and the doc comment for computeVelocity a couple lines down.