JavaScript is
good now

Talk by Matthew Gatland / @mgatland


What about

no mobile version…

no mobile version…

no mobile version…

no mobile version…

Unity makes it easy, but not that easy…

JavaScript is different.

What if I could tell you...

  • You can make a game today
  • And release it on iPhone tonight

What if I could tell you...

  • You can learn ONE progamming language
  • And release on EVERY platform
  • (no more Xcode!)

* M A G I C *

No App Store

(Actually, you can still use the app store if you want to)

(We'll talk about this later)

That's cool, but

can i make a real game?

Is JavaScript good enough?

  • graphics
  • smooth framerate
  • audio
  • controls
  • networking
  • App stores


2D, 3D, all devices

Going fullscreen

Going fullscreen

Going fullscreen

iOS 7.1+

<meta name="viewport" content="minimal-ui">




window.requestAnimationFrame(update) //called on every screen refresh

(Before this, there was no accurate timing in JavaScript!)


This used to be really bad

(especially on iPhone)

Now it's good – we can play multiple channels, change volume, use special effects, everything.

(remember the unmute hack)


I don't want any browser rubbish

  • NO double tap to zoom-in
  • NO swipe left to go back
  • Arrow keys should NOT scroll
  • ...

We can disable MOST default browser actions with one line:


(There are a few you can't disable)


Networking is a little complex, so I use a framework –

  var socket = io.connect("");

  //send a message
  var messageType = "state";
  var message = {x:10, y:10, health:99};
  socket.emit(messageType, message);

  //receive a message
  socket.on("state", function (data) {
  	//do stuff

JSON is easy, but inefficient... you can use binary instead.

Network limitations

Websockets can only do reliable connections.
We can't send unreliable (UDP) data.

WebRTC supports unreliable data, but it's not in iOS, Safari or Internet Explorer.

And Finally...


Distributing your game as a website is super easy.

(See Gridland and 2048)

But if you wanna get rich, you need to play in the App Store...


turns your JavaScript game into an app

free (for now)

totally easy

(they add a splash screen)

Cocoon.js (continued)

You can test this in < 5 minutes

Doing it for real is almost as easy - you need icons, licence keys...

PhoneGap is an open source alternative.


You can make a game today that people can play on every platform, right now.

You can distribute it on the web with NO DRAMA

(No expensive licence)

(No Xcode crashing all the time)

(No learning a new language for every platform)

(You don't even have to make a new build for each platform)


You can put it in the app store with ALMOST NO DRAMA

(Still no Xcode! :)

But you will need a developer account

Image credits for Creative Commons images:

  • 11.6" MacBook Air by Paul Hudson
  • My iPhone by Marck170601
  • Samsung Galaxy S4 Mini by GalaxyOptimus
  • Skeptical? by Mark Skipper –
  • Little Flame Character by Skorpio -
  • App Store icon from iOS 7-inspired Mac icon set by Tristan Edwards

Browser logos from


BY Matthew Gatland /