A small 2D platformer built with Python and Pygame. The project demonstrates core platformer mechanics, including player movement, collision detection, animation handling, level rendering, a side-scrolling camera, and game loop implementation.
- Python
- Pygame
- 2D player movement and controls
- Jumping and double-jump mechanics
- Sprite-based character animations
- Platform and object collision detection
- Side-scrolling camera system
- Terrain, traps, and environmental objects
- Game loop and real-time rendering
You need Python installed on your computer.
This project also requires Pygame:
py -m pip install pygameIf your system uses python instead of py, use:
python -m pip install pygameOpen a terminal in the project folder:
cd Pygame-PlatformerThen launch the game:
py Pygame.pyOr, if your system uses python:
python Pygame.pyMake sure you run the command from the project folder. The game loads images from the local assets folder, so running it from somewhere else can cause missing file errors.
| Key | Action |
|---|---|
| Left Arrow | Move left |
| Right Arrow | Move right |
| Space | Jump / double jump |
| Close Window | Quit the game |
Pygame-Platformer/
|-- Pygame.py
|-- README.md
|-- preview.png
`-- assets/
Pygame.py contains the main game code, including the player class, object classes, collision logic, drawing functions, and game loop.
assets/ contains the images and sprite sheets used by the game.
If you see this error:
ModuleNotFoundError: No module named 'pygame'
Install Pygame with:
py -m pip install pygameIf the game opens but images are missing, check that you are running the file from inside the project folder, not from another directory.
