HTML5 Game Development

HTML5 Game Development

Technology?

Question

It's ready, seriously.

Web API

Dead Trigger 2
  • Fullscreen
  • Pointer Lock
  • Gamepad

Mobile API

Firefox OS Flame
  • Vibration
  • Screen orientation
  • Battery status
  • WebSMS
  • Proximity sensor

List of APIs

WebTelephony, Vibration API, WebSMS, Idle API, Screen Orientation, Settings API, Power Management API, Mobile Connection API, TCP Socket API, Geolocation API, WiFi Information API, Device Storage API, Contacts API, Mouse Lock API, Open WebApps, WebBluetooth, Network Information API, Battery Status API, Alarm API, Browser API, Time⁄Clock API, Web Activities, Push Notifications API, Permissions API, WebFM API, FileHandle API, Network Stats API, WebPayment, IndexedDB, Archive API, Ambient light sensor, Proximity sensor, SystemXHR, ...

Vibration API

window.navigator.vibrate(200);

Screen orientation

        checkOrientation = function() {
          if(window.orientation == 0 || window.orientation == 180) {
            // "rotate your device"
          }
          else {
            // "keep playing"
          }
        }
      

Page visibility

        document.addEventListener("visibilitychange", function() {
          if(document.hidden) {
            // "app is not visible"
          }
          else {
            // "app is visible"
          }
        });
      

Tools

Tools

Free, easy to use

Writing JavaScript code

Sublime Text 2

Notepad, Sublime Text, Eclipse

Testing the game

Firebug

Browser + dev tools

Phaser

Phaser

phaser.io - free, open sourced on GitHub

Frameworks

HTML5 Game Engines list

html5gameengine.com

Compare

JS Breakouts

jsbreakouts.org

Knowledge

  • Articles, tutorials and blogs
  • Demos, open sourced games, videos
  • Community at html5gamedevs.com forums
  • Meetups, conferences, competitions

HTML5 Gamedev Starter

HTML5 Gamedev Starter

html5devstarter.enclavegames.com

Gamedev.js Weekly newsletter

Gamedev.js Weekly

gamedevjsweekly.com

Firefox OS

Firefox OS
  • Mobile OS written in JavaScript
  • Created and maintained by Mozilla
  • Open source, available on GitHub
  • Hardware platform for the mobile web

WebIDE

WebIDE
  • Managing applications
    and games
  • Editing environment
  • Firefox OS Simulator
  • Remote debugging

Publish

GitHub

Host your HTML5 games on GitHub Pages

Distribute

  • Portals
  • Publishers

Multiplatform

Multiplatform

Native apps

CocoonJS

Phonegap, CocoonJS, Intel XDK, Ejecta

Prepare your game
for Firefox Marketplace

Manifest file and submit form

Manifest file

manifest.webapp
        {
          "name": "Name of the app",
          "description": "Description of the app",
          "launch_path": "/",
          "icons": {
            "128": "/img/icon-128.png"
          },
          "developer": {
            "name": "Enclave Games",
            "url": "http://enclavegames.com"
          },
          "default_locale": "en"
        }
      

Submit form

Marketplace Form

marketplace.firefox.com/developers/submit/

Install from the Web

        var installapp = navigator.mozApps.install(manifestURL);
        installapp.onsuccess = function(data) {
          // "App was installed"
        };
        installapp.onerror = function() {
          // "App was NOT installed,
          // check the installapp.error.name for more info"
        }
      

Monetisation

Monetization
  • Paid games
  • In-app purchases
  • Advertisements
  • Licensing
  • Game-related

Wrapping up

Craigen in the Marketplace

  • Easy to build for
  • Easy to publish
  • Hardware platform
    for the Web
  • Create, test,
    publish, monetize!

Resources

Thanks! Questions?

  • {name}
  • Slides: {slideurl}