

The main things about the map is that it has a central area where the ghosts start from and it doesn’t have any other closed-in areas that the ghosts are likely to get trapped in (they can be a bit stupid sometimes). If you make your own, you’ll also have to make two more maps (we’ll come to those in a bit) which help with the running of the game. The one we will be using is very similar to the original, but you can make your own design if you want. The original game had a very specific layout to the maze, but many different ones have appeared in later versions. You can make these graphics yourself or you can use ours, which can be found on this GitHub repository. We can get our gameplay area set up straight away by blitting two graphics – ‘header’ and ‘colourmap’ – to 0,0 and 0,80 respectively in the draw() function. This will give us room for a roughly square maze and a header area for some game information. Let’s set our window size to WIDTH = 600 and HEIGHT = 660. Sign up to our newsletter to get a free digital PDF of The MagPi every month, or click here to subscribe to our print magazine.Īs with the more recent episodes of this series, let’s jump straight in, assuming that we have our basic Pygame Zero setup done. This article was written by Mark Vanstone and first appeared in The MagPi magazine issue #76. Easy retro gaming on a Raspberry Pi with Lakka and NOOBS.Rediscover Retro Computing in The MagPi #67.

In this first part, we will put together the basics of the Pac-Man game and introduce the concept of adding extra Python modules to our program. We will also use some more advanced programming concepts to make our games even better. This is the first instalment in a two-part tutorial which will show you some more tricks to writing arcade games with Pygame Zero. In this series we have gradually introduced new elements of Pygame Zero and also concepts around writing games. Avoid the ghosts unless you have just eaten a power-up, in which case ghosts are tasty. Pac-Man eats dots in a maze to score points.
