adeptnix 1 Report post Posted June 28, 2014 Hi. How to set a constant speed, so that it did not decrease in collisions with other bodies and boundaries of the world? Quote Share this post Link to post Share on other sites
valueerror 144 Report post Posted June 29, 2014 since p2 is a physics engine and there isnt something like constant speed in the real world beecause of friction i guess you need to apply a constant force like an engine in the car.. the moment you step of the gas pedal your car slows down..i would apply somesprite.body.velocity.x = 200;in the update loop. never step of the gas Quote Share this post Link to post Share on other sites
lewster32 616 Report post Posted June 29, 2014 Could this not be approximated by playing with the properties such as damping, mass and so on? I'm not familiar with P2 but I believe you have fine control over the collision 'materials' so you could theoretically make something incredibly (or infinitely?) bouncy, so it loses no or little speed upon impacts? Quote Share this post Link to post Share on other sites
valueerror 144 Report post Posted June 29, 2014 you could reduce mass to 0.1 gravityScale to 0 restitution to 1 and friction to 0 for the specific material, but eventually it will slow down because of collisions and if you dont reapply speed again maybe even turn around.. Quote Share this post Link to post Share on other sites
yasdar 0 Report post Posted October 29, 2014 sprite.body.damping= 0;sprite.body.mass= 0.1; Quote Share this post Link to post Share on other sites