Set constant velocity for body [Physics.P2JS]?

Recommended Posts

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

Share this post

Link to post
Share on other sites

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?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.