Jump to content

Friction when using Arcade physics


PicoFoundry
 Share

Recommended Posts

I am new to Phaser, so definitely a ton I do not know. I was experimenting with it by working on a little game where a player jumps from one platform to another, based on where the user clicks. I did this by setting the velocity of the player's body. However, once it lands on the other platform it just keeps sliding. I looked into the documentation and found a Friction property in Arcade.Body but I am not sure how to use it. I looks like it should be applied to the platform the player lands on, but it seems to require a point, and I have not been able to find an example using it.

 

I did implement a custom friction method using the collisionCallback used by the collide method, that reduces the x velocity incrementally to 0 and results in this behaviour:

 

http://gfycat.com/ZigzagBrownHoopoe

 

Which seems to work fine, but if there is a built in way to set it, I would prefer to use that.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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