Report a Bug

SIGN IN!

Gamepad.js API plugin


Adding support of gamepads (Xbox 360 and Playstation 3 controllers) to ImpactJS.
Plugin URL:  https://github.com/danthewolfe/gamepad.js
More Information:  https://github.com/danthewolfe/gamepad.js

EXAMPLE:

Put the following in your main.js update loop:

  1. var gamepad = new Gamepad.getState(0);
  2. var mappings = [[ gamepad.dpadUp, ig.KEY.UP_ARROW ],
  3. [ gamepad.dpadDown, ig.KEY.DOWN_ARROW ],
  4. [ gamepad.dpadLeft, ig.KEY.LEFT_ARROW ],
  5. [ gamepad.dpadRight, ig.KEY.RIGHT_ARROW ],
  6. [ gamepad.faceButton0, ig.KEY.X ],
  7. [ gamepad.faceButton1, ig.KEY.C ],
  8. [ gamepad.faceButton2, ig.KEY.Z ],
  9. [ gamepad.faceButton3, ig.KEY.V ]];
  10. new Gamepad.magic(gamepad, mappings);


   PLUGIN 
Contributed by:
dan
View Profile
Category:Utilities/Common
Updated:March 20, 2012
Version:N/A
Rating:
Your Rating (0)
Average Rating (0)
Ready to get to the point?

Your Email will remain private and is only used for good. We promise!


Please use only letters, numbers or underscores.

SIGN UP!