Skip to content

7echkilla/balloon-shooter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎈 Balloon Shooter Game

A simple 2D Balloon Shooter game built Pygame, following OOP principles. The player controls a gun to shoot moving balloons across different levels.

Level 2 screenshot

🎮 Game Overview

  • Control a gun using the keyboard
  • Shoot bullets to pop balloons
  • Choose between different levels
  • Balloons vary in movement, size, and count depending on the level

🕹️ Controls

Key Action
W Move gun up
S Move gun down
SPACE Move gun down

🧠 Game Design (OOP)

The project is structured using object-oriented principles:

  • Encapsulation: Each game entity (balloon, bullet, gun, level) is its own class
  • Inheritance: Levels inherit from a common base Level class
  • Modularity: Each component is separated into its own file for clarity and scalability

📁 Project Structure

balloon-shooter/

├── assets/ # Game assets (images and sound effects)
│ ├── balloon.png # Balloon sprite
│ ├── cannon.png # Gun sprite
│ ├── impact.mp3 # Bullet impact sound effect
│ ├── pop.mp3 # Balloon pop sound effect
│ └── silencer.mp3 # Shot sound effect

├── src/ # Core game source code
│ ├── balloon.py # Balloon entity and behavior
│ ├── bullet.py # Bullet/projectile logic
│ ├── game.py # Main game loop and state management
│ ├── gun.py # Player mechanics
│ ├── level_1.py # Level 1 configuration and logic
│ ├── level_2.py # Level 2 configuration and logic
│ └── level.py # Base level class and shared functionality

├── .gitignore # Files and folders ignored by Git
├── config.env # Environment and game configuration variables
├── LICENSE # Project license information
├── main.py # Game entry point
├── README.md # Project documentation
└── requirements.txt # Python dependencies

File Descriptions

  • main.py: Entry point of the game. Initialises and starts the game.
  • game.py: Handles the main game loop and prompts the user to select a level.
  • level.py: Base class for all game levels. Defines common behavior and structure.
  • level_1.py implements Level 1:
    • Single balloon
    • Random movement and size
  • level_2.py Implements Level 2:
    • Multiple balloons
    • Randomized movement and sizes for each balloon
  • gun.py: Manages gun movement and rendering.
  • bullet.py: Handles bullet creation, movement, and collision logic.
  • balloon.py: Defines balloon properties such as size, movement, and behavior.

▶️ How to Run

  1. Clone the repository: git clone https://github.com/7echkilla/balloon-shooter.git
  2. Navigate to the project directory: cd balloon-shooter
  3. Load dependencies: pip install -r requirements.txt
  4. Run the game: python main.py

About

A simple Pygame-based 2D game featuring balloons and real-time gameplay

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages