Skip to content

windstef/app12-super-mario-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Super Mario Implementation in Python

This is inspired by Meth-Meth-Method's super mario game

Running

  • $ pip install -r requirements.txt
  • $ python main.py

Standalone windows build

  • $ pip install py2exe
  • $ python compile.py py2exe

Controls

  • Left: Move left
  • Right: Move right
  • Space: Jump
  • Shift: Boost
  • Left/Right Mouseclick: secret

Current state:

Alt text

Dependencies

  • pygame
  • scipy

Contribution

If you have any Improvements/Ideas/Refactors feel free to contact me or make a Pull Request. The code needs still alot of refactoring as it is right now, so I appreciate any kind of Contribution.

Section 44: Day 44: App 12 - Code Review: The Mario Game

363. Programming Tool of the Day: Collaborating

Keynotes

  1. Provided the github repository https://github.com/arditsulceteaching/super-mario-python
  2. Fork this repository to my github account
  3. Clone the forked repository to my local IDE
  4. Do some changes
  5. Commit and push the changes to my repository
  6. Create Pull Request of the commit(s) to notify the other user to review and approve the changes
  7. For smaller teams just clone the repository and commit/push the changes directly to the repository.

364. Setting up the Project Locally

Keynotes

  1. Install the list of requirements mentioned in the file requirements.txt
  2. via command line pip install -r requirements.txt
  3. An error thrown: error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [33 lines of output] ... 4. The dependencies are installed from the IDE successfully. Installed packages: 'pygame==2.1.2', 'scipy==1.9.3'

365. Inspecting the Project Structure

Keynotes

  1. compile.py convert the Python project into an executable
  2. main.py the entry point of the program
  3. requirements.txt contains the required libraries to be installed
  4. settings.json contains some general settings about the game, e.g. sound effect, music on/off
  5. folder: classes each class in a single file for readability a.s.o file name is the class name
  6. folder: entities similar as classes
  7. suggestions: a. classes and entities file names to be in lowercase b. the folders' names to be renamed in some more specific meaning
  8. folder: img it contains the images are stored
  9. folder: levels it contains the data in json files. Reflect to the level of the game
  10. folder: sfx it contains the sound/audio files are located
  11. folder: sprites it contains images with data, e.g. background tiles
  12. folder: traits it contains the features that a player gets, e.g. jump higher

366. Inspecting the Code

Keynotes

  1. inspect the main.py
  2. the code is contained in the function main() when the file is executed directly
  3. To discover from where a method is called from the drop-down menu select: Find Usages and follow the chain of calls
  4. Also, after Find Usages click on the Call Hierarchy, and in reverse order
  5. In a file, class, choose the Structure tool to inspect it.

About

super mario in python and pygame

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%