🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

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

Started by
0 comments, last by Hex Coder 7 years, 10 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

Advertisement

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