17

Click here to load reader

Laboratory2D presentation at beer.js in Johannesburg South Africa

Embed Size (px)

Citation preview

Page 1: Laboratory2D presentation at beer.js in Johannesburg South Africa

What is Laboratory2DWhat is Laboratory2D

Page 2: Laboratory2D presentation at beer.js in Johannesburg South Africa

• Cross platform 2D engineCross platform 2D engine• 2 layers, can be used for 2 layers, can be used for

apps or gamesapps or games• Networking, physics, Networking, physics,

scripting, file system, UI, scripting, file system, UI, audio, etcaudio, etc

• Tech in C++Tech in C++• Game engine in JSGame engine in JS

Page 3: Laboratory2D presentation at beer.js in Johannesburg South Africa

Tech?Tech?

• Networking engineNetworking engine• Rendering engineRendering engine• Scripting engineScripting engine• Chrome embedded ( UI )Chrome embedded ( UI )• Event systems ( communication layer )Event systems ( communication layer )• File systemFile system• All performance related items should be in the C++All performance related items should be in the C++

Page 4: Laboratory2D presentation at beer.js in Johannesburg South Africa

Game engine?Game engine?

• Sprites, animationsSprites, animations• Level managementLevel management• Game play, mechanics, helpersGame play, mechanics, helpers• Base systems, colors, rectangles, Base systems, colors, rectangles,

points all needed for a gamepoints all needed for a game• Wrappers for tech, like networking, Wrappers for tech, like networking,

cameras, sounds etc.cameras, sounds etc.• Anything that is faster to iterate in JS over C++ should be in js. Don't Anything that is faster to iterate in JS over C++ should be in js. Don't

want to be digging in c++ for a simple animation class.want to be digging in c++ for a simple animation class.

Page 5: Laboratory2D presentation at beer.js in Johannesburg South Africa

PortabilityPortability

• C++ layer is portable, runs on C++ layer is portable, runs on Windows, Linux, Mac OSX and iOS Windows, Linux, Mac OSX and iOS ( and android, but not fully ported )( and android, but not fully ported )

• JS layer is portable, can run where JS layer is portable, can run where ever there is Javascript available. ever there is Javascript available.

• Games are portable, the API is shared Games are portable, the API is shared across platforms so the game code is across platforms so the game code is abstracted from the platformabstracted from the platform

Page 6: Laboratory2D presentation at beer.js in Johannesburg South Africa

Where does it come from?Where does it come from?

Page 7: Laboratory2D presentation at beer.js in Johannesburg South Africa

AuthorsAuthors

• Jon Parrott , a.k.a Josie Jon Parrott , a.k.a Josie http://github.com/jjramone13http://github.com/jjramone13

• Rendering engine, BeaRendering engine, Bea

• Sven Bergström , a.k.a FuzzYspo0NSven Bergström , a.k.a FuzzYspo0N

http://blog.centrc.nethttp://blog.centrc.net• The rest of the engineThe rest of the engine

• Third party lib authorsThird party lib authors

Page 8: Laboratory2D presentation at beer.js in Johannesburg South Africa

The sum of all its partsThe sum of all its parts

• Mootools, ENet, Boost, LZMA SDK, Mootools, ENet, Boost, LZMA SDK, Phoenix Core, Bea, 'Gamelab', V8, Phoenix Core, Bea, 'Gamelab', V8, Chrome, Berkelium, Awesomium, Chrome, Berkelium, Awesomium, SpiderMonkey, Angelcode Toolbox, SpiderMonkey, Angelcode Toolbox, CAudio, MongoDB BSON, GLFW, CAudio, MongoDB BSON, GLFW, Crypto++, LLV8, JSON::spirit, Crypto++, LLV8, JSON::spirit, miniupnpc, sqlite3 etc ...miniupnpc, sqlite3 etc ...

• But why?But why?

Page 9: Laboratory2D presentation at beer.js in Johannesburg South Africa

Fun!Fun!

• Writing the game I always wanted to Writing the game I always wanted to build required certain features. This build required certain features. This game needed an engine, rapid game needed an engine, rapid iteration, all of which over time - iteration, all of which over time - became something that I now call became something that I now call Lab2D. Lab2D.

Mostly about 6 months of 'experimenting Mostly about 6 months of 'experimenting with libraries' while working on the with libraries' while working on the game in my spare time led to the base game in my spare time led to the base features.features.

Page 10: Laboratory2D presentation at beer.js in Johannesburg South Africa

So.... Javascript!So.... Javascript!

Page 11: Laboratory2D presentation at beer.js in Johannesburg South Africa

Why Javascript?Why Javascript?

• CuriosityCuriosity• Cut throat fighting for performanceCut throat fighting for performance• Accessibility Accessibility • FlexibilityFlexibility• Asynchronous nature, easily eventedAsynchronous nature, easily evented• Something new to meSomething new to me

Page 12: Laboratory2D presentation at beer.js in Johannesburg South Africa

Personal Con ListPersonal Con List

• Operator overloadsOperator overloads• Portability might have been an issuePortability might have been an issue• Convincing others to take JS out of the Convincing others to take JS out of the

browser mindset and realise its just a browser mindset and realise its just a programming language.programming language.

• Debugging might have been an issue Debugging might have been an issue

Page 13: Laboratory2D presentation at beer.js in Johannesburg South Africa

Personal Epic WinsPersonal Epic Wins• TONS of libraries around ( mootools, TONS of libraries around ( mootools,

astar, physics, maths etc etc )astar, physics, maths etc etc )• Huge buzz around JS. node.js , Huge buzz around JS. node.js ,

EverythingYouCanThinkOf.js, HTML5 EverythingYouCanThinkOf.js, HTML5 games and libraries etcgames and libraries etc

• Mature languageMature language• Everyone I know who codes, has done Everyone I know who codes, has done

JS somewhere along the line. Now JS somewhere along the line. Now they can approach making games with they can approach making games with something less intimidatingsomething less intimidating

Page 14: Laboratory2D presentation at beer.js in Johannesburg South Africa

Sample codeSample code

Page 15: Laboratory2D presentation at beer.js in Johannesburg South Africa

Simple chat serverSimple chat server

Page 16: Laboratory2D presentation at beer.js in Johannesburg South Africa

Simple chat clientSimple chat client

Page 17: Laboratory2D presentation at beer.js in Johannesburg South Africa

Simple paddle classSimple paddle class