Member-only story
The first level of Super Mario built with Python!
Welcome back! Recently i’ve been taking a look at some very interesting Python projects on Github and I found a very interesting one, someone was able to build out the first level of the original Super Mario Bros game in Python! Let’s go ahead and take a look at this project, If you want to view this entire project check out the link below (please give all the credit to the developer of the code):
Let’s go into some details of this project!
The Code
This project is broken down into several different files, the data folder, resources folder, a Windows executable file, the mario_level_1.py file, the requirements file and a screenshot of this game:
Now let’s break down this project in a very high level fashion, essentially this game is built using Pygame, a very popular Python game development engine available for free, if you want to learn more about this package check out the website below:
The main file we run is the mario_level_1.py file, this file essentially calls several other Python files in the different folders, so looking in this specific file you can see we’re importing the main file within the subdirectory data/main.py:
So now looking at the main.py file in the data folder we are able to see this file calls on some other files:
At this point I would highly recommend following the thread of these file calls, this will allow you to understand the process of how this code works, since it’s essentially several files calling one another.