Skip to content

Repository files navigation

πŸ‘Ύ Alien Invasion

A classic arcade-style space shooter built with Python and Pygame. Defend Earth by destroying waves of aliens before they reach the bottom of the screen β€” each level gets faster, harder, and worth more points.


Gameplay

  • Move your ship left and right using the arrow keys
  • Shoot bullets with the spacebar
  • Destroy all aliens to advance to the next level
  • You have 3 lives β€” lose one every time an alien reaches your ship or the bottom of the screen
  • The game ends when all lives are lost

Features

  • πŸš€ Progressively increasing difficulty β€” alien speed and bullet size scale with each level
  • πŸ† Persistent high score saved locally to Highscore.json
  • πŸ“Š On-screen HUD showing current score, high score, level, and remaining lives
  • 🎡 Dynamic music playlist that cycles through tracks during gameplay, with a separate menu theme
  • πŸ”Š Sound effects for shooting, alien kills, level-ups, and losing a life

Controls

Key Action
← / β†’ Move ship
Space Fire bullet
Q Quit game

Installation

Requirements: Python 3.x

  1. Clone the repository:

    git clone https://github.com/your-username/Alien-Invasion-Game.git
    cd Alien-Invasion-Game
  2. Create and activate a virtual environment (VS Code recommended):

    python -m venv venv
    source venv/bin/activate      # macOS/Linux
    venv\Scripts\activate         # Windows
  3. Install dependencies:

    pip install -r Requirements.txt
  4. Run the game:

    python alien_invasion.py

Project Structure

Alien-Invasion-Game/
β”œβ”€β”€ alien_invasion.py   # Main game loop and core logic
β”œβ”€β”€ settings.py         # All game configuration and scaling values
β”œβ”€β”€ ship.py             # Player ship class
β”œβ”€β”€ alien.py            # Alien class
β”œβ”€β”€ bullet.py           # Bullet class
β”œβ”€β”€ button.py           # UI button (Play)
β”œβ”€β”€ game_stats.py       # Score, lives, level tracking + highscore persistence
β”œβ”€β”€ scoreboard.py       # HUD rendering
β”œβ”€β”€ Images/             # Ship and alien sprites
β”œβ”€β”€ Sound/              # Background music and sound effects
└── Highscore.json      # Auto-generated high score file

Built With

About

πŸ‘Ύ A Python & Pygame arcade shooter β€” destroy alien fleets, beat your high score, and survive as the difficulty ramps up each level.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages