Jump to content

P2 detecting collision before move


Ivanowski
 Share

Recommended Posts

Hi,
I'm creating a multiplayer game and I want to check if player moves, he collides with tilemap layer, but I need to check it before move, because I need to send this move on server. How can I do it? I really can't find help in docs...

Link to comment
Share on other sites

Thank you. I've created additional sprite that checks collision.
I've changed P2 to Arcade physics.

If the sprite position is different than player object, position in database updates.
If database position (which is updating via websocket) is different, update player position.

That's how I solve my problem :).
Repo (Not commented yet):
- State
- Player object

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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