A simple, endless side-scrolling arcade game built with Python and Pygame Zero. Navigate your hot air balloon through a world of obstacles, avoid the birds and buildings, and compete for the high score!
- Endless Gameplay: The game continues as long as you survive.
- Gravity Physics: Click to fly up, release to fall.
- Randomized Obstacles: Dodge birds flying at different heights, and avoid houses and trees on the ground.
- High Score System: Scores are automatically saved to a local file.
- Restart Function: Quickly restart after a crash without closing the window.
To run this game, you need:
- Python 3.x installed on your system.
- Pygame Zero library.
-
Clone the repository (or download the files):
git clone https://github.com/yourusername/balloon-flight.git cd balloon-flight -
Install dependencies:
pip install pgzero
or using the requirements file:
pip install -r requirements.txt
-
Asset Setup: Pygame Zero requires images to be placed in an
images/directory. Ensure your project structure looks like this:balloon-flight/ โโโ game.py โโโ high-scores.txt โโโ README.md โโโ requirements.txt โโโ images/ โโโ background.png โโโ balloon.png โโโ bird-up.png โโโ bird-down.png โโโ house.png โโโ tree.pngNote: You will need to provide your own image assets (PNG format) with the names listed above inside the
images/folder.
Execute the game using the pgzrun command:
pgzrun game.py- Left Mouse Click (Hold): Fly Up โฌ๏ธ
- Release Mouse: Fall Down (Gravity) โฌ๏ธ
- Objective: Survive as long as possible and avoid hitting obstacles or the edges of the screen.
The game tracks your top scores locally in the high-scores.txt file. When you crash, the top scores are displayed on the screen.
This project is open source. Feel free to modify and improve it!