Skip to content

Snake - Using a Game Engine

The concepts introduced in Muncher, Smash and Aliens were used to build a lightweight game engine that can be used to simplify building games in PyGame Zero. It takes away much of the boilerplate code that we needed to write in those earlier projects. The game engine is called Python Multi-Platform Game Engine (pmpge) and will be used for all of the Pygame Zero games from this point forwards. To demonstrate how the game engine works, we will use it to build a new game based around the Snake video game genre.

You will control Snake, moving her around the screen to eat pellets whilst avoiding crashing into the obstacles on the screen.

Each pellet will increase your score and increase the length of your Snake. As you score increases, so will the speed of your snake.

When you collide with the edge of the screen or an obstacle, you will die.

Learning points

There are no new learning points over the previous materials but you will get to use a game engine.

Step 0: Create the project in Replit

TODO: Write the instructions on how to create the game in Replit and download the game engine.