This is an example of an html5 multiplayer game with nodejs and socket.io.
git clone https://github.com/masylm/whatajong
npm install
cp default.conf.js conf.js
Edit the conf.js
file with your specific configuration and you are ready to go!
Half the game work in the client, and the other half in the server.
Both parts are communciated via socket.io exchanging events
and state
.
.-----------. .-------------.
| Server | | Browser 1 |
+-----------+ +-------------+
| | | |
| | <=== Events ======| public/js/* |
| | | |
| | '-------------'
| |
| serverjs |===== State (broadcast) ====>
| |
| | .-------------.
| | | Browser n |
| | +-------------+
| | | |
| | <=== Ecents ======| public/js/* |
| | | |
'-----------' '-------------'