From MozillaWiki
Jump to: navigation, search


Communications backchannels

  • #galaxy



Given that:

  • HB is curious about the galaxy controllers
  • Stumbler is going to check out leaderboards

Therefore, our priorities are:

  1. Leaderboards
  2. Off-the-shelf controllers
  3. Load-testing
  4. Localizations


  • Leaderboards: Complete and documented, awaiting feedback from MozStumbler contractors.
  • Controllers: Complete but needs more documentation. We should encourage people to contribute to the wrapper for galaxy.getGamepads. cvan has a fork of commits to upstream and a bunch of controllers to add controller mappings. cvan wants to make a standalone Controller Configuration tool that we can deploy to crowdsource controller mappings in the wild.
  • Login: Awaiting UX and integration help with Services.


  • cvan: documentation
    • overall approach/backgrounder -- completing week of 20140902
    • REST API docs -- complete at [1]
    • galaxy.js docs -- in progress at [2]. Working on after overall approach/backgrounder.
  • rfkelly: fxa integration, general backend helping-out

Game Center Roadmap

  • In lieu of a lobby, keep the list of games private.
  • Build a page for each game to show potential with API (e.g. show leaderboard, show who's playing); we can work with the game developers to skin/customize it as needed.
  • The "lobby" as previously envisioned, should be justified with interest stemming from HB, Stumbler, etc.


Below are the following GitHub repositories that comprise the Galaxy services.


Homepage of Galaxy games lobby (circa August 2014)


Contains the catalogue, a static web page, that showcases the games, leaderboards, and friends' activity.

During the build step, via Gulp and Metalsmith, the HTML is generated from static JSON files, Markdown files, and HTML templates. The compiled HTML talks to the backend API (`galaxy-api`) via WebSockets to render any user-specific information (i.e., leaderboards and friends' activity).

Technologies used

HTML, CSS, JavaScript, WebSockets, Node.js, Gulp, Metalsmith.




REST/WebSocket API


Contains the REST API server and the WebSocket server that the catalogue (`galaxy`) talks to and the in-game services (`galaxy.js`) talk to.

Such services include game, leaderboard, and leaderboard score creation.

Technologies used

Node.js, Koa, Chai, Mocha, Redis, PostgreSQL, WebSockets, Gulp.





Example Code



Contains the JavaScript file that developers can include in their games to get access to the Galaxy in-game services.

Technologies used

JavaScript, WebSockets, Gulp.




A drop-in JavaScript library for controlling an HTML5 game using WebRTC data channels.

Technologies used

JavaScript, WebRTC, WebSockets, Browserify (with Node), Gulp.


Screencasts & Demos

USB/Bluetooth Gamepads

Gameplay with USB controllers

A demo of cvan using two USB-based controllers (N64 and NES) to play a version of HexGL, a WebGL-based racing game, which has been modified to work with galaxy.js. Included in galaxy.js is galaxy.getGamepads, a simple, cross-browser wrapper around navigator.getGamepads, also providing mappings for various controllers on the market. Instead of writing lots of boilerplate code, game developers can simply listen to events (when buttons get pressed or axes change) or inspect a state object in their game loop.

Mobile Gamepads

Gameplay with Firefox OS mobile phone

A demo of cvan using a Firefox OS phone to play HexGL with galaxy.js. Also included in galaxy.js is galaxy.getMobileGamepads, an interface for pairing a mobile device with the Galaxy in-game services to provide accelerometer gameplay controls. Using the browser's deviceorientation events, we identify which direction the player is turning and whether the player is accelerating.

Screen Sharing

Streaming gameplay to a friend

A demo of Sathya playing HexGL whilst sharing his screen with a friend. Using Chrome's desktopCapture API from an extension, the screen is turned into a Media Stream, which is then streamed to another browser using WebRTC. (The API will be available soon in Firefox Nightly.)

Code available on GitHub.


Contact Information