marcovitch Posted November 6, 2018 Share Posted November 6, 2018 Hello, do you have an exemple to decelerate a velocity sprite in phase arcade physic ? Link to comment Share on other sites More sharing options...
mapacarta Posted November 7, 2018 Share Posted November 7, 2018 You can try using drag or you can calculate it yourself in update method. Here is how you can do it with setDrag: sprite.body.useDamping=true; sprite.setDrag(0.99);///takes value between 0-1 you can also set x,y seperately setDrag(x,y) samme 1 Link to comment Share on other sites More sharing options...
marcovitch Posted November 7, 2018 Author Share Posted November 7, 2018 Thanks mapacarta, I tested setDrag, (is not 0-1 but a "pixels seconde squared") so this solution not work fine for me. I use this exemple for testing "http://labs.phaser.io/edit.html?src=src\physics\arcade\velocity from angle.js" with no gravity and i would like make deceleration in the bird Link to comment Share on other sites More sharing options...
samme Posted November 7, 2018 Share Posted November 7, 2018 setDrag will work, with or without damping, as long as acceleration is 0. accelerate to (setDrag w/o damping) asteroids movement (setDrag w/ damping) mapacarta 1 Link to comment Share on other sites More sharing options...
mapacarta Posted November 9, 2018 Share Posted November 9, 2018 On 11/7/2018 at 11:40 AM, marcovitch said: Thanks mapacarta, I tested setDrag, (is not 0-1 but a "pixels seconde squared") so this solution not work fine for me. I use this exemple for testing "http://labs.phaser.io/edit.html?src=src\physics\arcade\velocity from angle.js" with no gravity and i would like make deceleration in the bird As far as I know when damping set to true, setDrag takes value between 0-1. I don't know how it works when damping is false Link to comment Share on other sites More sharing options...
marcovitch Posted November 12, 2018 Author Share Posted November 12, 2018 Ok it work now. thank's Link to comment Share on other sites More sharing options...
marcovitch Posted November 16, 2018 Author Share Posted November 16, 2018 Hi, I have a problem with my game (like 'billard' game), when I launch the first ball and when this ball is completely stoped if I launch seconde ball and this ball hit the frist the collider don't work (the first ball don't move) if you don't understand this is a exemple, you wait the first ball completly stoped exemple : https://codepen.io/marcovitch/pen/dQGomO Link to comment Share on other sites More sharing options...
Recommended Posts