Jump to content

Body Velocity Unit : pixels per second


jerome
 Share

Recommended Posts

Hello,

 

API documentation says for Class:Body : 

Properties:Name      Type          Descriptionvelocity  Phaser.Point  The velocity in pixels per second sq. of the Body.

per second squared ?

 

Distance par second squared is usually an acceleration unit.

Is velocity really expressed, for some reason, in px/s² ?

 

I need to precompute some time of moving for a sprite from its velocity :

timeToX = distanceToX / sprite.body.velocity.x;
Link to comment
Share on other sites

I think that's just an error int the docs.

(Possibly introduced by copy & paste, maybe the docs for gravity or acceleration have been copied over and the "sq." has been left by accident)

 

Your formula should work correctly.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...