This project is a simple 2D side-scrolling shooter created to learn and practice core Pygame concepts such as object-oriented programming (OOP), sprite animation, collision detection, sound handling, and basic game mechanics.
-
Player Health System (HP)
The player uses a health bar instead of a traditional score counter. -
Enemy Health Bar
The enemy (Goblin) displays its remaining health above its head. -
Collision Handling
Playerโenemy collisions reduce player health smoothly without freezing or repeated instant damage. -
Sprite Animation
Separate walking animations for both the player and the enemy. -
Enemy Patrol Movement
The enemy automatically moves back and forth between two boundary points. -
Sound Effects & Background Music
Includes shooting sounds, hit sounds, and looping background music.
- Python 3.x
- Pygame library
Install Pygame using pip:
pip install pygame| Key | Action |
|---|---|
| Left Arrow | Move character left |
| Right Arrow | Move character right |
| Up Arrow | Jump |
| Spacebar | Shoot projectile |
Pygame_first_project/
โโโ game.py
โโโ README.md
โโโ .gitignore
โโโ R1.png, R2.png, R3.png, ...
โโโ L1.png, L2.png, L3.png, ...
โโโ bg.jpg
โโโ bullet.mp3
โโโ hit.mp3
โโโ music.mp3
This project was developed while learning Pygame through tutorials from the YouTube channel:
Tech With Tim
Special thanks to TechWithTim for the clear, beginner-friendly tutorials that guided the development of this project.