DevTools Logo

Snake

Snake

Eat, grow, survive — classic snake with swipe or keyboard controls. Your best score stays in this browser.

Progress saves to this browser only — no account, no server.
Score
0
Best
0
Last
0
Length
3
Snake

Swipe or use the arrow keys to steer.

Swipe on mobile, arrow keys / WASD on desktop, Space pauses. The game pauses itself when the tab is hidden.

About this game

Snake is the arcade classic distilled to its essence: steer a snake around a grid, eat the pellet, grow one cell longer, and never touch your own body. Every pellet raises your score and slightly raises the pace, so a comfortable run never stays comfortable — the game you survive is faster than the game you started.

This version respects the device you are on. On touch screens you steer with swipe gestures or an on-screen D-pad; on a keyboard, arrow keys and WASD both work, and Space or P pauses. Two rule variants are a toggle away: deadly walls for the traditionalist, or wrap mode where the edges teleport you across the board — the same hunger, a completely different geometry.

The game is honest about attention. Switch tabs or lock your phone and it pauses itself instantly; the fixed-timestep loop clamps every frame, so a throttled background tab can never run the snake into a wall, inflate a score, or hand you an unfair death on return. Resume exactly where you left off.

Your best score, speed and wall-mode preferences and a play counter live in your browser's local storage — no account, no server, nothing leaves the device. The engine itself is pure and deterministic: the game loop owns only the clock, and stepping, eating, collisions and food placement are plain functions with injected randomness.

How to use

  1. Start

    Press Start (or an arrow key) — the snake launches horizontally from the middle of the board.

  2. Steer

    Swipe on mobile, arrow keys or WASD on desktop. Turns are queued one step ahead; reversals are ignored.

  3. Eat and grow

    Every red pellet adds one to your score and length and nudges the pace up. Choose Walls or Wrap before you start.

  4. Pause honestly

    Space or P pauses any time; hiding the tab auto-pauses. Best score and settings persist in this browser.

Use cases

The universal break

A run lasts seconds and needs one thumb — the original pick-up-and-play game, now with fair pausing.

Reflex and planning practice

Snake trains the look-ahead habit: every turn trades immediate food against the walls you are building around yourself.

Two rules, twice the game

Walls mode is a spatial-pressure puzzle; wrap mode is a pursuit curve — switching modes resets your instincts honestly.

Kid-friendly arcade

Slow speed and no accounts make it a safe first arcade game; the D-pad suits small screens.

Common mistakes

Mistake:Hugging your own wall of body

Fix:Stay near the open middle early on; the tail you leave behind is the trap you will meet on lap two.

Mistake:Turning twice into one step

Fix:Only one direction change lands per step — plan turns one cell ahead instead of mashing.

Mistake:Blaming the pause

Fix:The snake freezes when the tab hides and frames are clamped — a death after returning is a real collision, not background drift.

Frequently asked questions

References & standards