Snake Game
Eat food, grow longer, don't hit the walls or yourself!
Arrow keys / WASD to move · Swipe on mobile
How to play
Use arrow keys or WASD to steer the snake. Eat the red food to score points and grow longer. Avoid running into the walls or your own tail. The snake speeds up every 5 foods — how high can you score?
Why Snake is a Timeless Classic
Snake dates to arcade hardware in the mid-1970s and reached a global audience on Nokia phones in 1998 — a version that an estimated 400 million people have played. The game's staying power comes from a deceptively simple escalating challenge: the longer you survive, the longer your snake grows, and the less empty space you have to maneuver. A short snake on a large board is trivial. A long snake filling 80% of the grid is a spatial puzzle requiring careful path planning many moves ahead. This version preserves that exact tension — simple controls, clean canvas graphics, progressive speed increases, and a high score that follows you across sessions.
Key Features
- Canvas-rendered graphics: Snake, food, eyes, and grid are all drawn on an HTML5 canvas — no sprites or external files, loads instantly and renders cleanly at any screen size.
- Arrow keys, WASD, and swipe: Full keyboard control on desktop (both arrow keys and WASD), plus swipe gesture recognition on mobile touchscreens for one-hand play.
- Progressive speed levels: Speed increases every 5 foods eaten — the level display shows your current speed, and the game caps speed to remain playable even at high scores.
- Gradient snake body: The snake's color fades from bright green at the head to lighter green toward the tail — a nice visual that makes it easy to see which end is which at a glance.
- Persistent high score: Your best score is saved in localStorage and displayed at session start — gives you a personal record to chase each time you play.
- Reverse-direction protection: The game prevents you from instantly reversing direction into your own tail — a common quality-of-life feature that prevents accidental instant deaths from double-tapping.
Real-Life Use Cases
- Spatial reasoning challenge: At high scores, Snake becomes a genuine spatial planning exercise — you need to navigate a long snake through tight spaces without cornering yourself, which trains path-finding intuition.
- Reflex and pattern training: The progressive speed increase means each new speed threshold is its own mini-challenge — a new reflex ceiling to break through.
- Nostalgic entertainment: For anyone who grew up with Nokia phones or early arcade games, Snake delivers the same satisfying loop in a modern, zero-friction browser package.
- Quick gaming session: A Snake run lasts anywhere from 30 seconds to 10 minutes depending on skill level — the perfect length for a break between tasks without overcommitting.
Who Can Use This
Snake has no age barrier and no learning curve — if you can press a direction key, you can play. The challenge scales naturally with the snake's length, so beginners are eased in before things get genuinely difficult. Touch support makes it equally playable on phones and tablets, so there's no device limitation either.
Tips & Best Practices
- Work the edges early: When your snake is still short, eating food along the perimeter of the board keeps your body out of the center where future paths are harder to plan. Build from the outside in.
- Think in terms of exit paths, not just food: Before turning toward food, ask yourself: "If I make this move, will I have enough space to turn away afterward?" Food that requires a dead-end approach isn't worth the risk.
- Keep your tail in your peripheral vision: The most common death isn't hitting a wall — it's losing track of where your own tail is. Keep one eye on it while steering toward food.
- Slow down at higher speeds: Counterintuitively, try to steer in straight lines at high speed rather than making sharp turns. Straight paths give you more reaction time; sharp turns at speed often result in misjudged collisions.
- Use WASD on desktop for comfort: For long sessions, WASD with your left hand is more ergonomic than arrow keys — your hand rests more naturally on the home row area.