A space shooter built with Pygame, based on Chapter 12 of Python Crash Course by Eric Matthes.
I modified it a bit.
Alien Invasion is a 2D side-scrolling space shooter. The player controls a ship that moves horizontally along the bottom of the screen and fires bullets upward. The goal is to survive waves of descending aliens while destroying as many as possible. The game features a simple score system, lives, and increasing difficulty as the alien fleet descends. You'll learn OOP here a lot!
-
Install Pygame: pip install pygame
#Depends on the pygame version, you can do "py" or "python". Then the name of the file which also depends on you
-
Run the game: python alien_invasion.py or py alien_invasion.py
alien_invasion/ ├── alien_invasion.py # Main game loop & event handling ├── settings.py # Game configuration ├── ship.py # Ship class ├── bullet.py # Bullet class └── images/ # Sprite assets
-
Eric Matthes – Python Crash Course, dunno what version
-
Official code: https://github.com/ehmatthes/pcc_3e
-
this is what it looks like on the front page
-