Balls online is a multiplayer browser game where you are a ball. You can move your ball and see other balls moving. The only purpose it serves is as a playground for game and netcode concepts.
Visit https://balls.bojodev.io for a live preview.
yarnyarn dev- In a different terminal:
node server.js --watch - Visit http://localhost:5173
- Use the arrow keys to move around
- In
socket.js, you can configure lag emulation in ms by changing thelagvalue. The client will wait this long to send your events to the server. - In
main.js, you can turn client prediction on/off by changing thepredictionboolean.
- Add lag emulation when receiving events as well
- Split up files
- Add server reconciliation support
- Add client-side interpolation support
- Implement better client-side prediction
- Convert to TS
- Deploy live demo