155
edits
| Line 53: | Line 53: | ||
== Screencasts & Demos == | == Screencasts & Demos == | ||
=== USB/Bluetooth Gamepads === | |||
[[File:Galaxy_gamepad_controller_demo_thumb.png|left|link=https://wiki.mozilla.org/images/d/d7/Galaxy_gamepad_controller_demo.webm|thumb|Gameplay with USB controllers]] | |||
A demo of cvan using two USB-based controllers (N64 and NES) to play a version of [http://hexgl.bkcore.com/ HexGL], a WebGL-based racing game, which has been modified to work with <tt>galaxy.js</tt>. Included in <tt>galaxy.js</tt> is <tt>galaxy.getGamepads</tt>, a simple, cross-browser wrapper around <tt>navigator.getGamepads</tt>, 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. | |||
<div style="clear: left"></div> | |||
=== Mobile Gamepads === | |||
[[File:Galaxy_websockets_mobile_controller_demo_thumb.png|left|link=https://wiki.mozilla.org/images/0/00/Galaxy_websockets_mobile_controller_demo.webm|thumb|Gameplay with Firefox OS mobile phone]] | |||
A demo of cvan using a Firefox OS phone to play HexGL with <tt>galaxy.js</tt>. Also included in <tt>galaxy.js</tt> is <tt>galaxy.getMobileGamepads</tt>, an interface for pairing a mobile device with the Galaxy in-game services to provide accelerometer gameplay controls. Using the browser's <tt>deviceorientation</tt> events, we identify which direction the player is turning and whether the player is accelerating. | |||
<div style="clear: left"></div> | |||
== Archives == | == Archives == | ||
edits