Skip to content

An experiment with socket.io and accelerometer (control your desktop with multiple mobile devices)

License

Notifications You must be signed in to change notification settings

topheman/playground2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TOPHEMAN PLAYGROUND V2

This repository is DEPRECATED, please visit the new version at topheman/playground

Intro

Try it at : https://topheman-playground.herokuapp.com (heroku instance).

Presentation : http://slid.es/topheman/topheman-playground

Once you snapped the QR-code with your phone, take control of the bouncing ball on your desktop screen, like a Wiimote, tilting your phone as you would do on a labyrinth game.

  • Connect with multiple mobile devices
  • Watch from multiple desktop/laptop screens

You can even use the devicemotion emulator to control the ball from your desktop.

Not a game, more of an experiment that could lead to a game …

Thanks to remote-tilt for the emulator.

Topheman Playground

Install

  • npm install
  • node app.js 192.168.1.2:3000 (192.168.1.2:3000 being the public IP:PORT of your node server - port by default at 3000 - this is used to create the QR-Code)

OK for node v4 & v5

Next

I coded the v1 about a year ago, and now I decided to refactor it so that it could be a sort of a boilerplate for some other games.

Take it, make your own games and tell me about it !

Notes

On their first version, heroku didn't provide WebSockets support, so socket.io fallbacked to xhr-polling. That's now fixed.

When you'll browse the code, you'll see that there is a connection/disconnetion routine on the sockets which makes sure to disconnect any mobile client which has more than one socket opened (to prevent multiple dead balls). This was a tricky part, playing with the express session and the socket.io handshake :-) …

About

An experiment with socket.io and accelerometer (control your desktop with multiple mobile devices)

Resources

License

Stars

Watchers

Forks

Packages

No packages published