adeptnix Posted June 28, 2014 Share 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? Link to comment Share on other sites More sharing options...
valueerror Posted June 29, 2014 Share 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 Link to comment Share on other sites More sharing options...
lewster32 Posted June 29, 2014 Share 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? Link to comment Share on other sites More sharing options...
valueerror Posted June 29, 2014 Share 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.. Link to comment Share on other sites More sharing options...
yasdar Posted October 29, 2014 Share Posted October 29, 2014 sprite.body.damping= 0;sprite.body.mass= 0.1; Link to comment Share on other sites More sharing options...
Recommended Posts