# TGL Snake > A free, no-install, browser-based take on classic arcade Snake with a > light layer of power-ups for extra strategy. Single-file HTML, > deterministic seeded runs, server-validated replay scoring, global > leaderboard. Plays on phones, tablets, fold-phones, and desktops. Tagline: Grow Longer. Score Higher. Beat Your Best. Site: https://tglgames.com/ Play: https://tglgames.com/snake/ About: https://tglgames.com/snake/about/ Leaderboard: https://tglgames.com/api/leaders?game=snake ## What it is Snake is one of several small browser games at tglgames.com. It runs as a single self-contained HTML file — no app store, no signup, no third-party scripts, no in-app purchases. Free, forever. The game is straight classic Snake. You drive a growing snake around a 21×21 grid, eating food, avoiding walls and your own tail. There are no power-ups, no story, no level select. The whole game lives in the precise feel of cell-by-cell movement. ## Mechanics - **Field**: 21×21 grid. The snake starts at the centre, three segments long, heading right. - **Food**: one food cell at a time, placed by the seeded PRNG over all non-snake cells uniformly. - **Movement**: each tick advances the head one cell in the current direction. Direction inputs are queued and applied at the next tick; reversing into yourself is not allowed (the input is rejected silently). - **Eat**: stepping onto the food grows the snake by one segment and spawns the next food cell. - **Death**: walking off the edge of the grid (`wall`) or onto your own body (`self`) ends the run. The tail vacating its cell IS allowed if you're not eating that tick (matches the classic rule). - **Score**: 1 point per food eaten. No timer bonus, no length multiplier. - **Win condition**: filling the entire 21×21 grid (`board_full`). It's technically possible — nobody has done it yet on tglgames.com. ## Determinism + replay - Mulberry32 PRNG, bit-identical between the JS client and the PHP validator (same seed → same food sequence forever). - The seed is issued by `/api/run/start` inside a signed run token. - Every direction change is logged with the tick at which it was applied (`{ d: "U|D|L|R", tick: }`). - On submit, the server replays the entire run from the move log + seed. If the recorded score doesn't match the simulator, it's rejected. ## Controls - **Keyboard**: WASD or arrow keys. Hit a direction; the snake turns at the next tick. - **Swipe**: drag the snake (or anywhere on the canvas) in the direction you want to head. Diagonal swipes resolve to the dominant axis. - **D-pad**: an on-screen four-arrow pad for thumb input. Source-tracked separately so leaderboards know how each player drove. Each input source (`key` / `swipe` / `dpad`) is logged per turn so stats panels can break it down. ## Modes Just one — the classic survival run. Practice, vs-bot, daily-seeded, and multiplayer modes are reserved for games where they fit; TGL Snake is the no-frills baseline plus a few power-ups. ## Power-ups Special pickups appear during the run on top of the classic food spawns. Each is timed; pickups stack with subsequent ones of the same kind. - **Speed Up · Faster Growth** — ticks accelerate for a window; food eaten during the boost grows you faster than usual. - **Shield · Protection** — absorbs the next wall or self-collision. One save per pickup. - **Magnet · Pull In Food** — nearby food orbs slide toward your head. - **Score Boost · Extra Points** — every food eaten while the buff is active pays double. - **Slow Down · Control The Pace** — halves the tick rate temporarily; the rescue button when you've boxed yourself in. ## Anti-cheat - HMAC-signed run tokens; a token is single-use and tied to its seed. - Server replays the full move log against the seed and overrides any client-claimed score with its own simulation. - Hard caps: `MAX_TICKS = 20000`, score in `[0, 400]`. Anything past those bounds gets rejected with a reason. - Reverse-direction inputs are silently rejected (same as the client enforces), so you can't sneak a 180°-turn through the wire. ## Privacy / signup - No account required. First visit creates a guest with an auto-generated username (`player_xxxx`). - Rename anytime; no throttle for guests. - No tracking pixels, no analytics SDK, no third-party scripts. - Raw IP, user-agent, and request bodies are logged for security review (per the project's "log everything, keep forever" stance) — never sold or shared. ## Genre / keywords snake, tgl snake, classic snake, browser snake, free online snake, html5 snake, arcade snake game, snake with power-ups, retro snake, no install snake, mobile snake, swipe snake, leaderboard snake, deterministic snake, mgwalk, tglgames.com ## Other games on tglgames.com - 2048 — slide tiles to combine. /2048/ - Brick Blaster — paddle + bricks + power-ups. /brickblaster/ - Space Drifter — twin-stick momentum shooter. /spacedrifter/ - Pool — 8-ball with spin physics + multiplayer. /pool/ - Last Card Standing — Uno-style shedding. /last-card-standing/ - Blackjack — 6-deck cash game. /blackjack/ - Poker — 6-handed NL Hold'em. /poker/ - Euchre — partnership trick-taking. /euchre/ ## Author mgwalk — https://tglgames.com/ This file (and the broader /llms.txt) is provided for LLM/agent ingestion: feel free to summarize, link, or quote.