post-modern-game-input



post-modern-game-input

0 0


post-modern-game-input

Slides for JSConf 2013 talk

On Github iceddev / post-modern-game-input

Post Modern Game Input

JSConf 2013

WhomTF?

@MONTESLU

@IcedDev

frozenjs.com

Gaming?

HTML5 gives us a bunch of lego pieces to connect together and build really cool things.

Game Loop

window.requestAnimationFrame(). 60 times/second

Keyboard

if(im.keyActions[keys.LEFT_ARROW].isPressed()){
    //move the player to the left
}

Mouse / Touch

//mobile first :)
var position = im.touchAction.position || im.mouseAction.position;

Here comes the Hammer

Gestures

//hamer code

Demo

Gamepads

navigator.webkitGetGamepads();

Gamepad Polling

Just check the gamepad state.

Demo

Post-Modern

Phone as a Gamepad

There's an app for that...

yay itunes, yay google play

It's called a Browser

demo

You have to use your hands?

That's like a baby's toy.

Camera Face Tracking

Donut Horns made by B-Reel for Google hangouts

Voice Recognition

Web Speech API

new webkitSpeechRecognition();

Demo

3D Tracking

  • Leap Motion
  • MS Kinect

Leap Motion

WebSockets !

bindings for Java, CSharp, python...

leap.js

  var controller = new Leap.Controller({enableGestures:true});
  controller.on('frame', function(frame) {
    game.pointables = frame.pointables;
  });
  controller.connect();

Demo

But I want to wear a controller...

Project Glass

Mirror API

Face

https://github.com/monteslu/Face

Face API

demo

Connect ALL the things.

Websockets are your glue.

Thank You

@MONTESLU