This prototype contains all necessary basic features to start up a NodeJS Typescript web-based game project inspired by http://surviv.io/ It includes:
- Network solution using Websocket
- Server Reconciliation / Client-side Prediction
- Entity Interpolation
- Messaging using Binary Array with bit-buffer
- Collision Detection using SAT.js
- Rendering with PixiJS
- Webpack configurations for both client and server
- Optional Heroku configuration
Make sure you have nodejs and npm installed. Install all necessary packages with
npm install
Then run:
npm run build:dev
which should build server and client in the dist/
folder.
To run the server:
npm run start
Then open a client at https//localhost:8080/
package.json comes with all necessary commands to build the project on Heroku. When git pushed to Heroku, heroku-postbuild
command is automatically called, building the project remotely with prod configuration.
To set up your heroku project, please follow the instruction here
Use the commands
npm run watch:client
and
npm run watch:server
to automatically rebuild locally server and client while editing the typescript code.