Score
{{ score }}
Best
{{ bestScore }}
Length
{{ snakeLen }}
Level
{{ level }}
Combo
x{{ combo }}
Time
{{ runTimeLabel }}
Focus
{{ focusSeconds }}s
Next level in {{ applesUntilLevel }} apples • {{ applesIntoLevel }}/{{ applesPerLevel }}
{{ comboFlash }}

Online Snake Game

Dial in your pace and chain apples for elite combos.

Sprint from apple to apple to raise your combo multiplier and unlock Focus slow-mo boosts.
Controls
  • move
  • Ppause/resume
  • Rrestart
  • Ffullscreen
  • Mmute
  • Stack quick turns for x5 combos and grab glowing cores for Focus or score bursts.

Run Summary

  • Score{{ runSummary.score }}
  • Level{{ runSummary.level }}
  • Time{{ runSummaryTimeLabel }}
  • Length{{ runSummary.length }}
  • Apples{{ runSummary.apples }}
  • Max combox{{ runSummary.combo }}
Walls
Metric Value Copy
{{ row.label }} {{ row.value }}
:

Introduction:

Snake is a grid based arcade game where a moving line grows as it eats apples and the run ends on a crash. It offers a quick skill loop with simple rules and a steady sense of progress. A classic snake game with wrap walls suits short breaks and light competition.

Play unfolds on a discrete board where the head advances one cell each tick and body segments follow. You choose a speed to set the rhythm and you decide whether walls wrap or act solid. The aim is to collect apples, extend the body, and raise your score.

Arrow keys steer the head so it turns without reversing into its neck and the line cannot pass through itself. Pause, restart, fullscreen, and mute let you fit a quick run into a busy day.

Eating one apple adds ten points times your current combo multiplier and one segment, so the turning radius tightens as the run goes on. Fast speed feels exciting, but it leaves less time to plan, so expect abrupt endings.

For consistent comparisons, stick with one speed and one wall mode and favor smooth inputs over frantic taps. If a run ends early, take a breath and try again.

Technical Details:

The model is discrete motion on a rectangular grid. At each tick the head advances by a unit step and the body shifts forward, preserving order. Score increases by fixed increments per apple and body length grows by one segment, which tightens maneuvering space.

Apple placement samples uniformly from free cells. Border behavior is selectable: wrapping treats edges as connected, while solid walls end the run on an out of bounds move.

Direction changes are queued, and direct reversal is blocked so the head cannot turn into the neck. Self collision checks the next head cell against occupied cells before movement is finalized.

Comparisons across runs are meaningful when speed and wall mode match and when randomness in apple placement is acknowledged. Best score is kept per device and reflects local play only.

nx = ( x+dx+Ncol ) mod Ncol ny = ( y+dy+Nrow ) mod Nrow S' = S + 10·m (on eat)
Symbols and units
Symbol Meaning Unit/Datatype Source
Ncol Grid columns integer constant (20)
Nrow Grid rows integer constant (20)
Δt Tick duration by speed milliseconds derived
S Score integer derived
m Combo multiplier (1 – 5) integer derived
L Body length segments derived
(x,y) Head coordinates integers derived

Level ups shave about seven milliseconds from the base tick down to a 60 ms floor, while Focus temporarily adds roughly 55 ms back.

Worked example. On a 20 by 20 board with wrapping on, a head at (19, 10) moving right steps to:
nx = (19+1+20) mod 20 = 0
If the next cell contains an apple, the score updates as S'=S+10·m where m is the current combo tier, and the length increases by one. With solid walls, a step to x=20 would end the run.
Speed modes and implications
Speed Mode Tick (ms) Interpretation Action Cue
Slow 190 More planning time, wider safety margins. Practice routes before levels accelerate.
Medium 130 Balanced pace for most runs. Build consistency before chasing combos.
Fast 90 High tempo from the outset. Favor safe turns and lines.
Variables and parameters
Parameter Meaning Unit/Datatype Typical Range Sensitivity Notes
Speed Tick rate selection enum slow · medium · fast High Affects difficulty directly.
Walls Border behavior boolean wrap or solid High Wrapping reduces dead ends.
Grid Background guides boolean on or off Low Visual aid only.
Trails Fading tail markers boolean on or off Low Cosmetic feedback.
Volume Beep loudness 0.0–1.0 0.0 to 1.0 Medium Muted when sound is off.
  1. Queue direction changes; block reversals into the neck.
  2. Compute next head cell from current direction.
  3. If wrapping, reduce coordinates modulo grid size.
  4. If solid walls and out of bounds, end the run.
  5. Detect self collision in the next head cell.
  6. On apple, grow by one and add ten points times the active combo multiplier; else move forward.
  7. Place the next apple on a free cell uniformly at random.

Randomness, seeds & reproducibility. Apple placement uses uniform integer sampling with rejection on occupied cells, so successive runs diverge naturally without a fixed seed.

Networking & storage behavior. Best score persists in your browser under a single key and no gameplay data is transmitted to a server.

Performance & complexity. Each tick updates positions and checks for collisions; collision checks scale with current length.

Diagnostics & determinism. Identical inputs yield identical motion for a given apple sequence; differing random apple positions lead to different routes.

Assumptions & limitations
  • Board size is fixed to 20 × 20.
  • Score advances in steps of ten points multiplied by the combo multiplier.
  • One apple exists at any time.
  • No diagonal movement is allowed.
  • Input is keyboard only.
  • Apple selection tries random samples before a fallback sweep.
  • Sound is a brief synthesized tone.
  • Heads‑up Fullscreen sizing follows device viewport constraints.
  • Heads‑up Repeated rapid key presses can queue multiple turns.
  • Heads‑up Best score is device specific.
Edge cases & error sources
  • Simultaneous opposite key presses are ignored as reversals.
  • Holding keys may queue turns later than expected.
  • Window resizing can shift the visible play area briefly.
  • Entering fullscreen may adjust the camera span.
  • Very long runs increase collision checks per tick.
  • Rare dense snakes reduce random apple placement success.
  • Muted sound prevents audible eat feedback.
  • System focus loss can pause inputs momentarily.
  • Low frame rates reduce visual smoothness at fast speed.
  • Keyboard layout differences can affect key locations.
  • Accessibility tools that capture arrows may block input.
  • Browser power saving can delay tick timing slightly.

How‑to Play:

Grid movement with growing length and fixed increments guides both steering and risk management.

  1. Select Speed based on comfort.
  2. Choose Walls as wrap or solid.
  3. Press Enter or the on‑screen start.
  4. Steer with Arrow keys; avoid reversals.
  5. Collect apples to grow and score.
  6. Use P to pause and R to restart.
Example. Start on medium with wrap walls, collect three apples for 30 points and lengthen by three. Switch to solid walls when you want tighter routing practice.

Finish a run, check your best, and adjust speed or walls for the next attempt.

Features:

  • Preset speeds feed an adaptive level curve that tightens turns as you grow.
  • Combo multipliers unlock Focus slow-mo bursts when you chain apples quickly.
  • Dynamic lighting and adaptive camera cues reinforce Focus slow-mo bursts.
  • Glowing bonus cores deliver score surges or extended Focus time.
  • Optional grid, trails, pause, restart, fullscreen, mute, and per-run summaries stay close at hand.

FAQ:

Is my data stored?

Only your best score is kept in your browser. No gameplay data is sent to a server.

Clearing site storage resets the best score.
How is scoring handled?

Each apple is worth ten points times your active combo multiplier. Keep eating within the streak window to climb as high as 5×.

What does Focus do?

Focus slows time briefly so you can thread tight gaps. Earn it by hitting combo tiers or collecting blue bonus cores.

What are the control keys?

Arrows steer, P pauses, R restarts, F toggles fullscreen, M mutes. Enter starts from the menu.

Can I change speed mid‑run?

Pick your speed before starting. To change later, restart from the menu and select a new speed.

What does wrap vs solid mean?

Wrap carries the head to the opposite edge on exit. Solid ends the run when the head leaves the board.

How do I pause quickly?

Press P to pause or resume at any time during a run.

Does muting affect gameplay?

No. Sound provides feedback only and does not change timing or difficulty.

Can I play without the grid?

Yes. Toggle grid and trails off for a cleaner look if you prefer.

Troubleshooting:

  • No response to arrows — click the playfield to focus, then try again.
  • Run ends instantly — avoid direct reversals into the neck.
  • Choppy motion — lower speed or close other heavy tabs.
  • Muted sound — press M to toggle and check device volume.
  • Fullscreen cropped — exit and re‑enter fullscreen after resizing the window.
  • Score did not save — verify that site storage is allowed in your browser.

Privacy & Compliance:

Scores are stored locally in your browser and not transmitted or stored server‑side.

This game includes random elements and has no monetary value.

Glossary:

Tick
One discrete update of movement and checks.
Wrap walls
Edges connect so exits reappear on the opposite side.
Solid walls
Edges are lethal and end the current run.
Direction queue
Buffered turns applied in order, no reversal allowed.
Best score
The highest score saved on your device.
Trail
A short lived visual left by recent segments.
Apple
The pickup that grows length and adds points.
Segment
A unit of body length that follows the head.