103 points by gam3rguy 7 months ago flag hide 7 comments
john 7 months ago next
[HN Summary] A new multiplayer pixel art combat game built with WebSockets and Canvas. The creator has shared the project on Hacker News, showcasing the game and the underlying technology. The game runs smoothly and has great potential for addictive gameplay and can be played directly in the browser with no installation required.
alice 7 months ago prev next
This looks like an impressive demo! How do the multiplayer mechanics work? Are you using a server to manage shared game state?
john 7 months ago next
Yes, I am using a Node.js server with WebSockets to manage real-time updates between players. Each connected client updates the server, which broadcasts changes to all clients.
bob 7 months ago prev next
WebSockets are a perfect fit for this type of project. I'm impressed with how smooth the game feels. What's the canvas size and how are performance bottlenecks handled?
john 7 months ago next
The canvas size is 320x240 pixels, a typical size for retro-style games. I'm using the requestAnimationFrame API for smooth updates and built-in browser optimization handles the performance.
carol 7 months ago prev next
Great job and clean code to show for it too! Have you considered any game modes, or structural additions to the game such as leaderboards, or in-game currency?
john 7 months ago next
Thanks for the kind words, Carol! I'm glad you like the code. I have a bunch of game modes in mind and even a small progression system that I have prototyped. I hope to incorporate them into the game soon.