Lazo Lab Sign up

Python Projects & Skills / Games

Lesson 10 of 28

Snake game

Snake stores the body as a list of grid positions. Each tick, add a new head in the moving direction and remove the tail unless the snake just ate.

Key points

  • Body is a list of (x, y)
  • Insert head, pop tail
  • Game over on wall or self hit
Watch a video on thisOpens YouTube search results for “Snake game” in a new tab

Quiz · +10 XP

How does the snake grow after eating?

Log in to save progress and earn XP.