Linux Format

Recreate classic retro platform games

PYTHON

Credit: https://github.com/mx0c/super-mario-python

OUR EXPERT

Andrew Smith is a software Developer for NHS Digital. He enjoys scripting in Python and playing video games.

QUICK TIP

When practising with new or unfamiliar code, always back up the file you are practising with, so if anything goes wrong, it is easy to recover.

During the early to mid-’90s, platform games were incredibly popular on game consoles. The king of the platformer was Nintendo and iterations of Mario games were rolled out for the Nintendo Entertainment System and Super Nintendo Entertainment System. This means that, even today, people still love to play Super Mario Bros and its ilk in a staggering array of variations.

For this instalment, we are looking at a Python project created by Marius Bauer (https://github.com/ mx0c) that aims to ape the original Super Mario World video game. We’ve modified and adapted the code for the benefit of this tutorial and are using replacement original sprites and game titles to appease the legal eagles. The original (unmodified) source code and resources can be found at the following Git: https:// github.com/mx0c/super-mario-python.

The aspects of the project that we’re covering in this tutorial include looking at the overall structure of the project, the video game menu, loading game characters by sprite sheet and looking at the code that controls how the video game characters are moved in the game program. Before we can do any of this, though, we first need to make sure we have the correct environment set up.

Let’s go!

We’ll install and set up Python 3.10 for the benefit of this tutorial. For those who have Python/PyGame already installed, Python 3.8+ should

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format2 min read
For The Experts
Hyper’s reliance on a text file for configuration will appeal to many more experienced Linux users, and it’s a boon that Hyper both scans for changes to the file and can open the file via the main menu. In theory, you could customise how this termina
Linux Format8 min read
Create A Fyne Journaling App
Credit: https://fyne.io Over the past decade, we have seen great improvements in the graphical software user experience and corresponding advancements in the tools that are used to create compelling apps for our phones and tablets. Unfortunately, bui
Linux Format3 min read
QIDI Tech Q1 Pro
It feels like QIDI Tech has been sitting in the back of the room, taking notes while we discuss other 3D printers’ flaws. The Q1 Pro fixes many of the little problems: it eliminates levelling guesswork by setting its own Z height; the spool holder is

Related Books & Audiobooks