Comment Comment by igravious Tampermokey userscript -- <space> to launch and restart <esc> to give up```javascript // ==UserScript== // @name StarFling Spacebar // @namespace https://playstarfling.com/ // @version 2026-04-11 // @description Spacebar to launch and restart StarFling // @author Claude Code // @match https://playstarfling.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=playstarfling.com // @grant none // @run-at document-idle // ==/UserScript== (function () { 'use strict'; document.addEventListener('keydown', function (e) { if (e.code === 'Escape') { e.preventDefault(); // During play, click give-up to trigger the death/restart screen const giveup = document.getElementById('giveup-btn'); if (giveup) giveup.click(); return; } if (e.code !== 'Space') return; e.preventDefault(); // If the game-over screen is visible, click retry const gameOver = document.getElementById('game-over'); if (gameOver && !gameOver.classList.contains('hidden')) { const retry = document.getElementById('retry-btn'); if (retry) retry.click(); return; } // Otherwise simulate a tap on the canvas (start from menu / release orb) const canvas = document.getElementById('c'); if (canvas) { canvas.dispatchEvent(new PointerEvent('pointerdown', { bubbles: true, clientX: window.innerWidth / 2, clientY: window.innerHeight / 2, })); } }); })(); ``` parent igravious 7 months ago
```javascript
```