WebSockets or how to develop
game in 4 hours
Sorokin I. I.
WebSockets or how to develop
game in 4 hours
Sorokin I. I.
Tags cloud
#WebSockets
#Socket.IO
#2048
#multiplayer
#HTML5
#javascript
#nodeJS
WebSockets…defines a full-duplex single socket connection over which messages can be sent between client and server
Socket.IO
Even better than clean WebSockets
Event oriented model
Cross Platform clients
http://socket.io/
«Hello world» on Socket.IO
-Do u like play in 2048?-Sure!
-Sorry that we can not play with each other…:(
-Wait 4 hours-WHAT???
4 hours ago…
2048 multiplayer
I call it Binary Battle
It’s not 4 hours (near 12 really). 4 - used for PR:)
U can fork it and make your own game with no big changes in 4 hours really!
Now u know who is the best in 2048!!!
How it works
Little bit home made:)
More words
Game manager - core of applications, it store all the games data, it’s just an infinity loop
Players manager - store players data (socket id, name, etc…)
2048 core was taken from origin game (just cut some useless things) and u can replace it easy for your own game engine
Picture is good, but where is the code???
Front-end
Back-end
Features, limitations…
Using RAM as a storage, server down - game over :(
Auto-remove games data when game is over
Refresh page - your status will reset, enemy - not :)
2048 using as a module and u can replace it to any other game engine
BinBattle
https://github.com/asynxis/binbattle
FORKSWANTED