Skip to content

Instantly share code, notes, and snippets.

View easierbycode's full-sized avatar

▓▒░ ♔ Daniel ♔ ░▒▓ easierbycode

View GitHub Profile
@easierbycode
easierbycode / gamepad-logger.js
Created June 2, 2025 22:24
gamepad-logger.js
let prevButtonStates = [];
let fullscreenToggled = false; // Flag to ensure fullscreen is toggled only once
window.addEventListener("gamepadconnected", (e) => {
console.log(`Gamepad ${e.gamepad.index} connected`);
prevButtonStates[e.gamepad.index] = [];
requestAnimationFrame(pollGamepads);
});
function pollGamepads() {
@easierbycode
easierbycode / hero.js
Last active May 31, 2025 19:05
hero.js
import { isset } from './utils.js';
const HERO_DEPTH = 50;
const IS_DEV = new URL(window.location.href).searchParams.get("debug") == "1";
// Running
const RUNNING_RIGHT = 'RUNNING_RIGHT';
const RUNNING_LEFT = 'RUNNING_LEFT';