Hey! Fellow Python programmers. In this article, I’m going to provide you with a free source code of the Super Mario game using the python pygame module. You can use this source code to learn pygame module. Also, you can add this game to your portfolio or use it as a project in your school or college.
Installing Python On Your computer
First of all, you need to install python on your computer. For downloading python visit python.org. You should better download python version 3.7 or higher. While installing the python make sure you have tick marked “Add Python To PATH” otherwise you will get an error while installing any module or library in python.
If you want to check whether python is successfully installed on your computer or not. Just go to cmd or terminal whatever you have on your computer and type python. There you can see which version of python has been installed on your computer. If it does show the version of python like in the image below you could not have followed the steps properly. You should recheck the previous steps carefully.
The above image that is in my case, it’s showing the 3.9 version. Yours will be different as per the python version you have installed.
Before downloading the source code you have to know about pygame module. Which your computer requires to run the code.
If you are not aware of what the pygame is? Basically, pygame is a free and open-source cross-platform library for the development of multimedia applications like video games using Python. It uses the Simple DirectMedia Layer library and several other popular libraries to abstract the most common functions, making writing these programs a more intuitive task.
How To install pygame?
First of all, you need to install python on your computer, and along with that install python-pip. Python uses pip to install packages.
In order to install pygame on your computer write the below code in your cmd or terminal.
pip install pygame pytmx
Note: If you see an error like “pip isn’t recognized” . It means that you haven’t added the pip in your environment variable. Follow this youtube tutorial to resolve the error.
After successful installation of pygame module. All you need to do is just download the Super Mario python project source code.
Click here to download the zip file.
Note : If you are finding an issue with downloading. Make sure you have signed in with a google account in order to download from google drive or to open the link in google drive.
After downloading the zip file of the source code all you need to do is extract it and navigate to the next folder and after that, you have to run the main.py file.
So this will
Do have a look at How to make a 2d snake game, Flappy Bird game, and Fidget Spinner using python. Furthermore, Don’t forget to share this article with your programming buddy. Also, don’t hesitate to shower your love or give remarks in the comment section below.