websockets or how to develop game in 4 hours - tech hangout #39 - 2014.05.30

14
WebSockets or how to develop game in 4 hours Sorokin I. I.

Upload: innovecs

Post on 10-May-2015

311 views

Category:

Education


0 download

DESCRIPTION

On May 30, in the format of Tech Hangout internal meetings Ivan Sorokin, Software Engineer at Innovecs, told us about “WebSockets or how to develop game in 4 hours”. *TECH HANGOUT COMMUNITY was found in 2012 by the developers for the developers for knowledge and experience sharing. Such meetings are the part of Innovecs Educational Project that actively develops sphere of internal trainings and knowledge exchange program among professionals. This Initiative was born within the walls of Innovecs and has proved to be extremely popular and high-demand. In a short period of time it gained its own Facebook group with more than 100 members, blog with more than 40 posts and constant quarterly external meeting of Tech hangout community with more than 80 participants. The concept of the event proposes a 30-minute report on the topic previously defined, and the discussion in a roundtable session format. Join to discuss - https://www.facebook.com/groups/techhangout/

TRANSCRIPT

Page 1: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

WebSockets or how to develop

game in 4 hours

Sorokin I. I.

Page 2: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

WebSockets or how to develop

game in 4 hours

Sorokin I. I.

Page 3: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

Tags cloud

#WebSockets

#Socket.IO

#2048

#multiplayer

#HTML5

#javascript

#nodeJS

Page 4: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

WebSockets…defines a full-duplex single socket connection over which messages can be sent between client and server

Page 5: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

Socket.IO

Even better than clean WebSockets

Event oriented model

Cross Platform clients

http://socket.io/

Page 6: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

«Hello world» on Socket.IO

Page 7: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

-Do u like play in 2048?-Sure!

-Sorry that we can not play with each other…:(

-Wait 4 hours-WHAT???

4 hours ago…

Page 8: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

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!!!

Page 9: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

How it works

Little bit home made:)

Page 10: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

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

Page 11: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

Picture is good, but where is the code???

Front-end

Back-end

Page 12: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

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

Page 13: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

BinBattle

https://github.com/asynxis/binbattle

FORKSWANTED

Page 14: WebSockets or how to develop game in 4 hours - Tech Hangout #39 - 2014.05.30

@sorokinvanya - twitterhttps://github.com/asynxis

Thanks for attention!