blobs-io / blobsgame

✨ The official repository for the blobs browsergame
7 stars 2 forks source link

Better coordinate handling #71

Closed y21 closed 5 years ago

y21 commented 5 years ago

Without this implementation the client emits coordinates every millisecond and the server emits an array with all blobs every 10 milliseconds which is heavily unefficient. The client now only emits an event when the user changes the direction. It calculates the X/Y position by using the UNIX timestamp of when the direction was changed and where it was changed (coordinates).