This demo demonstrate how to get gamepad input with Shaku.
Note: Gamepads are only recognized in browsers once you press a button.
Main Gamepad (index 0):
The following code shows how to get Gamepad input.
// everything below goes between startFrame() and endFrame()
const gamepad = Shaku.input.gamepad(0);
if (gamepad.leftButtons.top) player.moveUp();
if (gamepad.leftButtons.down) player.moveDown();
if (gamepad.leftButtons.left) player.moveLeft();
if (gamepad.leftButtons.right) player.moveRight();