Advertisement

HTML5 Canvas / Node.js / Socket.io networking pointers

Started by September 01, 2016 12:53 AM
0 comments, last by Hex Coder 8 years, 2 months ago
Hi everybody, this is my first post so I'm sorry if it's not easy to understand.
Last week I went through a tutorial on how to make a basic HTML5 Canvas game using JavaScript.
I decided to expand upon that game by making it multiplayer with a Node.js/Socket.io server.
The gameplay is currently laggy except for when I run the clients and server locally (Narrowing the problem down to bad networking).
I was wondering if anybody could take a look at the game and code (Github repo provided) and tell me where I'm going wrong with my networking and what I could do to improve it.
I'm sorry for my terrible and messy code, I'm learning :)

Game - http://quiet-brook-59546.herokuapp.com/
Github - http://www.github.com/XyreJamesyoui/html5game

It's not too laggy really, just you need some client-side interpolation code - right now the position only changes when it receives a new packet, so between packets the player doesn't move. I'm sure further googling on the topic of client-side interpolation will guide you in the right direction.

This topic is closed to new replies.

Advertisement