Play on your desktop. Steer with your phone. Scan a QR code and your phone becomes a wireless, analog joystick.
- Host โ open the demo on a computer. A glowing QR code + 6-digit code appears.
- Connect โ scan the QR with your phone camera (or type the code). It auto-connects โ no app, no install.
- Play โ tap โถ to start, then tilt the joystick to steer. Push further to go faster.
The snake never stops โ you steer it at any angle (not just up/down/left/right), and speed scales with how far you push the stick. Eat food quickly to build a ๐ฅ combo (up to ร6) before the streak timer drains.
- ๐ฑ Phone-as-controller โ a custom touch joystick streamed to the desktop in near real-time over Firebase.
- ๐ฏ Analog, continuous-angle movement โ steer by angle; magnitude controls speed. No grid-snapping.
- ๐ฅ Combo streaks โ chain quick eats for a score multiplier, shown as a draining yellow timer badge.
- ๐ Juice โ particle bursts, ripples, floating score pops, and screen shake on impact.
- ๐ Synthesized sound โ Web Audio SFX whose pitch climbs with your combo; one-tap mute.
- ๐คณ Flex your score โ share to WhatsApp, X, Facebook, or Instagram straight from your phone.
- โก Offline-ready PWA โ installable, with a network-first service worker.
- ๐ Single-device fallback โ a
localStoragemode kicks in automatically when Firebase isn't available. - ๐ Audience analytics โ Google Analytics 4 for audience + campaign insight, tagged desktop-host vs. phone-controller. IP-anonymized, and it never blocks gameplay.
| Control | Action |
|---|---|
| ๐น๏ธ Joystick | Rotate to steer (any angle) ยท push further to speed up |
| โถ Center button | Start the game (turns into ๐ while playing) |
| โจ๏ธ Space / Enter (desktop) | Restart after a crash |
| ๐ Play Again (phone) | Restart from the game-over share card |
Vanilla JavaScript (no bundler, no modules) ยท HTML5 Canvas ยท Firebase Firestore (session + game state) + Realtime Database (joystick stream) + Analytics (GA4) ยท PWA (installable, offline shell) ยท Firebase Hosting with auto-deploy via GitHub Actions.
There's no build step โ just serve the static public/ folder.
npm install # dev tooling only: firebase-tools, eslint, vitest, prettier
npm start # โ npx serve -s public (http://localhost:3000)Any static server works too, e.g. python -m http.server 8000 --directory public.
- Open on a desktop-width window to host the game.
- Append
?session=123456to the URL (or open on a phone) to load the controller view in a second tab/device.
npm run lint # ESLint
npm test # Vitest unit tests (tests/)
npm run format # PrettierDeploys are automatic on push to master (GitHub Actions โ firebase deploy --only hosting). Database/Firestore rules are not shipped by CI.
Plain <script> files share one global scope, loaded in a fixed order โ there's no import graph. The desktop owns the game loop, rendering, and collision; the phone captures the joystick. They pair over a 6-digit code / QR via Firebase, with a localStorage fallback for single-device use.
๐ค Full map for contributors and AI agents lives in CLAUDE.md, with a deeper index under
.agent/.
PRs welcome โ see CONTRIBUTING.md. We use Conventional Commits (feat | fix | refactor | style) and branch as feature/โฆ, bugfix/โฆ, docs/โฆ.
Made with โค๏ธ by Aryaman Godara ยท โญ the repo if you enjoyed it!