How to Make a Snake Game with a Twist
Everyone has played Snake, so a plain clone has nothing to say. Here is how to build the classic loop properly, and eight twists that make it yours.

Key takeaways
- Classic Snake runs on a fixed tick over a grid, with the body stored as a list of cells.
- Queue up to two turns per tick and reject reversals, or fast players will crash into themselves through no fault of their own.
- Pick one twist and design around it. A twist changes the decision the player makes, not just the art.
To make a snake game, move a snake one grid cell per tick in its current direction, grow it when it eats food, and end the game when it hits a wall or itself. That classic loop fits in a page of code. The details that make it feel good are a fixed tick rate, a turn queue that never loses an input, and food that never spawns inside the snake. And because everyone has played Snake, the real design question is your twist. This guide covers the loop first, then eight twists worth building.
The classic loop, done properly
Grid and tick
Snake is a grid game, not a smooth-movement game. Pick a grid (around 15 by 15 to 20 by 20 cells fits a phone in portrait) and move the snake exactly one cell per tick. A tick rate of about 8 to 12 moves per second is a comfortable range for the start; speed it up gradually as the snake grows, with a cap. Rendering can still be smooth: draw the snake sliding between cells based on how far through the current tick you are, which looks modern while the logic stays crisp. The core game loop guide explains why that short, repeated moment is the heart of a game.
The body is a list of cells
Store the snake as an ordered list of cells, head first. Each tick: compute the new head cell from the direction, add it to the front, and remove the last cell, unless the snake just ate, in which case keep the tail (that is the growth). Checking collisions is then simple: is the new head outside the grid, or on any body cell? One subtlety: the tail cell moves away this tick, so moving into the cell the tail is leaving should be allowed.
The turn queue
The most common bug in Snake clones: the player presses up then left quickly within one tick. If the game only keeps the latest key, the “up” is lost; if it applies both immediately, the snake can reverse into itself. The fix:
- Keep a small queue of turns (up to two is enough).
- When a key or swipe arrives, compare it with the last direction in the queue (or the current direction if the queue is empty). Ignore it if it is the same direction or the exact opposite.
- Each tick, take one turn from the queue, if any.
This makes fast corner turns (a U-turn in two presses) work reliably, which is exactly what skilled players do.
Food and score
- Spawn food only on empty cells: pick randomly from the list of free cells, never by retrying random positions (which gets slow when the snake fills the board).
- Score per food, plus a bonus item that appears briefly and is worth more.
- Winning is possible: if the snake fills the board, celebrate. Few players get there, which makes it special.
Controls on phones
Arrow keys and WASD on desktop. On phones, swipes anywhere on the screen are the most natural: a swipe of about 30 pixels or more, direction by the larger axis, read on movement rather than on release so a quick flick turns immediately. Offer an optional on-screen pad for players who prefer buttons. Feed all inputs into the same turn queue. The touch controls guide covers swipe handling and stopping the page from scrolling.
Eight twists that change the game
A twist is good when it changes what the player has to think about. Pick one and build the game around it:
- 01Portals: pairs of linked cells on the board. The snake enters one and exits the other, and its body is split across both for a while. Planning routes becomes spatial puzzling.
- 02Gravity snake: the snake is seen from the side and falls when unsupported, as in the puzzle game Snakebird. It turns Snake into a level-based puzzle game with handmade levels.
- 03Spelling snake: food is letters; eat them in order to spell the target word shown at the top. Wrong letters shrink the snake. Pairs well with a daily word.
- 04Rhythm snake: ticks are locked to the music’s beat, and turning exactly on the beat gives a bonus. Music changes tempo between stages.
- 05Two snakes, one player: the same swipe moves two snakes on mirrored boards. Brain-melting and very shareable.
- 06Shrinking world: the walls close in every 30 seconds, forcing the snake toward the center. Rounds stay short.
- 07Puzzle boards: fixed levels where the snake must eat every item in a limited number of moves, with obstacles. Snake becomes a thinking game.
- 08Multiplayer arena: many snakes on one big board, where cutting across another snake’s path eliminates it. That is the .io direction; see our .io game guide for rooms, server ticks and bots.
The brief to paste
A snake game with portals, for phones and desktop. 18 by 18 grid; the snake moves one cell per tick, starting at 9 moves per second and speeding up slightly every 5 foods, capped at 15. Drawn smoothly between cells. Body stored as a list of cells; growth by keeping the tail when eating; moving into the cell the tail is leaving is allowed. Turn queue of up to 2, ignoring same and opposite directions. Swipes anywhere on the screen (read on movement, 30 pixel threshold) and arrow keys or WASD. Each level has two or three portal pairs in different colors; entering one exits from its twin, keeping direction. Food spawns only on free cells. Walls kill. 10 levels with handmade wall and portal layouts, each won by eating 15 foods; a golden bonus food appears for 5 seconds now and then. Score and best score per level saved on the device. Instant restart with a tap.
Making a 50-year-old idea feel fresh
- Smooth movement and a face: a head with eyes that look toward the food gives a lot of personality for little work.
- Eating feedback: a bulge that travels down the body after each meal, a soft crunch sound, a small pop of particles.
- Death that shows the cause: freeze briefly on the collision and highlight the cell before showing the score.
- Board themes per level: colors and backgrounds that change as the player progresses.
- A short countdown on start: three beats before the first tick, so the player’s thumb is ready and the first move is never a surprise.
Lay out level walls and portals by hand in the World Editor instead of describing coordinates. When it is done, publish and share it to the Arcade. If puzzle boards are your twist, the puzzle game guide covers teaching through levels and checking solvability. Snake is one of the best game ideas for beginners, and a weekend is enough to try two twists with the weekend prototype guide.
Frequently asked questions
How fast should a snake game move?
Around 8 to 12 grid moves per second is a comfortable start, speeding up gradually as the snake grows, with a cap so the game stays playable.
Why does my snake die when I turn quickly?
The game is probably applying two turns in one tick or losing the first key press. Store turns in a small queue, take one per tick, and ignore turns that reverse the current direction.
How can I make my snake game different?
Add one twist that changes the player’s decisions: portals, gravity, spelling words, rhythm, shrinking walls, puzzle levels or a multiplayer arena. Prototype it quickly and keep it only if the first minute is interesting.

