Ivanowski Posted April 13, 2017 Report Share Posted April 13, 2017 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... Quote Link to comment Share on other sites More sharing options...
MikeW Posted April 13, 2017 Report Share Posted April 13, 2017 I am far from an expert here - but could you create a invisible sprite and move that to check. I am very interested if there is a better way. Quote Link to comment Share on other sites More sharing options...
Ivanowski Posted April 14, 2017 Author Report Share Posted April 14, 2017 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.