Skip to content

mahmudnibir/shooting-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Shooting Game 2.0

A 2D side-scrolling shooter game built with Pygame featuring multiple levels, enemy AI, and collectible items.

Features

  • Multiple game levels with CSV-based level design
  • Player character with shooting and grenade mechanics
  • Enemy AI with basic pathfinding and combat
  • Collectible items (health, ammo, grenades)
  • Environmental hazards (water, obstacles)
  • Menu system with level selection
  • Sound effects and background music
  • Smooth scrolling background with parallax effect
  • Health and ammo HUD display

Requirements

  • Python 3.x
  • Pygame

Installation

  1. Clone the repository:
git clone https://github.com/mahmudnibir/shooting-game-2.0.git
cd shooting-game-2.0
  1. Install dependencies:
pip install pygame

Controls

  • LEFT/RIGHT Arrow Keys: Move
  • UP Arrow Key: Jump
  • SPACE: Shoot
  • RIGHT SHIFT: Throw grenade
  • ESC: Quit game

Project Structure

shooting-game-2.0/
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ audio/
โ”‚   โ”‚   โ”œโ”€โ”€ music2.mp3
โ”‚   โ”‚   โ”œโ”€โ”€ jump.wav
โ”‚   โ”‚   โ”œโ”€โ”€ shot.wav
โ”‚   โ”‚   โ””โ”€โ”€ grenade.wav
โ”‚   โ””โ”€โ”€ images/
โ”‚       โ”œโ”€โ”€ button_image/
โ”‚       โ”œโ”€โ”€ player/
โ”‚       โ”œโ”€โ”€ enemy/
โ”‚       โ”œโ”€โ”€ tile/
โ”‚       โ”œโ”€โ”€ explosion/
โ”‚       โ””โ”€โ”€ resources/
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ level*.csv
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ”œโ”€โ”€ buttons.py
โ”‚   โ”œโ”€โ”€ screen_fade.py
โ”‚   โ”œโ”€โ”€ healthbar.py
โ”‚   โ”œโ”€โ”€ menu.py
โ”‚   โ””โ”€โ”€ win_msg.py
โ”œโ”€โ”€ requirements.txt
โ””โ”€โ”€ README.md

Game Mechanics

  • Player can move, jump, shoot bullets, and throw grenades
  • Enemies patrol their area and shoot when player is in range
  • Collect health packs, ammo, and grenades from item boxes
  • Complete levels by reaching the exit point
  • Avoid environmental hazards like water
  • Health system with damage from bullets and grenades

Development

The game is built using Pygame and follows object-oriented programming principles. Key classes include:

  • Soldier: Base class for player and enemy characters
  • World: Manages level loading and tile-based environment
  • ItemBox: Handles collectible items
  • Bullet and Grenade: Projectile mechanics
  • Menu and WinScreen: Game state management

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Nibir Mahmud

Acknowledgments

  • Pygame community for resources and documentation

About

Python Shooting Game โ€“ A dynamic shooting game developed with Python, featuring advanced functionalities like shooting, grenade throwing, ammo management, health system, and more. ๐ŸŽฎ

Topics

Resources

License

Stars

10 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages