Roam

How to make a snake game

Snake is the classic first coding project because the whole game is a grid and a list. The head moves one cell, the tail follows, food makes it longer and touching yourself ends the run.

How Snake works

Snake became famous on Nokia phones from 1997, starting with the Nokia 6110. Every version uses the same few parts.

Code it in Python

Twists worth trying

Snake without code

If you want the game more than the coding exercise, describe it to Roam, a free iPhone app: arena, theme, what the snake eats. It comes back playable, and you can play it with friends.

Play it on Roam

Create your snake game with Roam

Pick the arena and the twist. Play it on your iPhone, then say what to change.

Try: "neon snake arena, eat glowing orbs to grow, boost costs length, my friends are the other snakes"

Questions people ask

How long does it take to code Snake in Python?

A beginner following a tutorial can usually finish a basic version in an afternoon. Menus, sound and high scores take longer.

What is the best language to code a snake game?

Python with pygame is the most common choice for beginners. JavaScript with an HTML canvas is a close second.

Can I make a snake game without coding?

Yes. Scratch uses blocks instead of text, and Roam builds a playable snake game from a sentence on iPhone.

Keep exploring