Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

horizon-joy

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

horizon-joy

Game controllers for Horizon Joy

latest
Source
npmnpm
Version
1.0.11
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

HorizonJoy

Adopt your game for TV by using mobiles as controllers

joystick

Usage

  • Get HorizonJoy from NPM with npm i horizon-joy --save
  • Include dist/JoyGame.js into project
  • Now you have window.joyGame which is an events emitter and is your gate to the world of Horizon Joy
  • You may listen to joystick events with joyGame.addEventListener(eventName , callback);
  • You run the game on box or TV
  • User opens http://horizonjoy.com on his phone (phone should be on same internet router to join the game)
  • Now user is able to use gamepad which sends events to the game running on TV

Events

  • playerenter - someone opened http://horizonjoy.com from your router and entered game on your TV, seems you should spawn a new player, callback passed argument will give you some data about user joined
  • playerquit - someone quit game, seems you should remove a player using id from callback passed argument
  • keydown - key was pressed. Callback argument brings some data about keyCode and user who pressed
  • keyup - key was released. Callback argument brings some data about keyCode and user who pressed

Demo

Please, have a look at Bombergirl demo we have in demo folder. This is a third aparty HTML5 game which was modified to use HorizonJoy. You might be interested in GameEngine.js:321, GameEngine.js:327 and InputEngine.js:30

To run demo please do following:

Bombergirl developed by Matouš Skála ( http://matousskala.cz ) and is distributed under Creative Commons license.

Issues

Feel free to drop your questions to hi@denisradin.com

FAQs

Package last updated on 14 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts