A 2D platformer game built with Python and pygame-ce.
The project contains multiple levels stored as JSON maps, a playable game client, and a utility for visualizing level layouts.
- 🕹️ 2D platformer gameplay
- 🗺️ Multiple levels
- 📄 Levels stored as JSON files
- 🎨 Level visualization with NumPy and Matplotlib
- ⚙️ Simple and easy-to-understand project structure
- 🖥️ Ready-to-run EXE version available
- 🐍 Built with Python and pygame-ce
| Key | Action |
|---|---|
← |
Move left |
→ |
Move right |
Space / ↑ |
Jump |
- Python 3.14.7
pip
Make sure that the Python version matches the version used for development.
Clone the repository and open a terminal in the project directory:
git clone https://github.com/artem121112111211-coder/Platformer.git
cd PlatformerInstall the required packages:
pip install -r requirements.txtFrom the repository directory, run:
python main.pylevel.py is a development utility used to visualize the game's level maps.
It reads the JSON level files from the Levels directory and generates PNG images representing their layouts.
To generate the level images, run:
python level.pyThe generated images are saved in the Levels directory.
- NumPy — processes the level matrix.
- Matplotlib — renders the level as an image.
A ready-to-run EXE version is available in:
The EXE version does not require manually running main.py.
Platformer/
│
├── Icon/
│ └── ... # Game icons and graphical resources
│
├── Levels/
│ ├── level1.json # Level 1 map
│ ├── level2.json # Level 2 map
│ ├── level3.json # Level 3 map
│ ├── level4.json # Level 4 map
│ └── ... # Generated level images/resources
│
├── main.py # Main game program
├── level.py # Level visualization utility
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore rules
├── LICENSE # Project license
└── README.md # Project documentation
The main game logic is located in main.py.
To start the game during development:
python main.pyGame levels are stored in the Levels directory as JSON files.
The level data is loaded by the game and can also be visualized using:
python level.pyWhen modifying a level, regenerate its visualization if you want to update the corresponding PNG preview.
Project dependencies are listed in requirements.txt.
To install them:
pip install -r requirements.txtWhen adding a new external Python dependency, add it to requirements.txt so that other developers can reproduce the development environment.
A typical workflow for contributing to the project:
git pullMake your changes, test the game, and then commit them:
git add .
git commit -m "Describe your changes"
git pushFor level-related changes, it is recommended to test both:
python main.pyand:
python level.pyThis project is distributed under the license included in the LICENSE file.
Artem
GitHub: artem121112111211-coder