Skip to content

Instantly share code, notes, and snippets.

@easierbycode
Created June 2, 2022 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save easierbycode/5b633d979b531610edd61e668fa8477f to your computer and use it in GitHub Desktop.
Save easierbycode/5b633d979b531610edd61e668fa8477f to your computer and use it in GitHub Desktop.
listen-for-gamepad-on-gameover
export function addGameOverLayer() {
Properties.gamepad.on('down', (pad, btn, value) => {
console.log({
pad,
btn,
value
});
if (pad == 9) {
restartGame()
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment