Jump to content

MoveTo delta speed and online timing


Mickety
 Share

Recommended Posts

So I'm making an online game with socket.io and phaser and I run into a little problem:

Everything moves faster on PC while android devices lag behind.

I use game.physics.arcade.moveToObject to move to a waypoint but the same problem occures with moveToXY and other methods.

Here is logic:

Two players are on the map in the same X position but different Y positions.

Player one on PC clicks on a location to the right a few pixels and starts moving to right on both screens of PC and Android device.

Player one arrives to desired location earlier on PC while still moving on Android.

 

Movement implemented with constant speed of 32 in update scope if player's current position is not equal to corresponded player's waypoint which is updated via websocket signal from server.

game.time.advancedTiming is set to true and desiredFPS to 35. This did help but only a little.

 

How should I approach this? Is there such a thing as delta speed? I could also periodically update player's location that server would keep track of but last time I checked there was no phaser module for node.js, so I can't really calculate player's location serverside.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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