Welcome to Stack Invaders, a Space-Invaders inspired arcade shooter where every stage celebrates a different programming language. Blast through themed enemy waves, collect power-ups, and face bosses that weaponize iconic keywords!
- Requirements: Python 3.10+ and Pygame. Install dependencies with:
pip install pygame
- Run the game:
python main.py
- Audio tip: The game gracefully continues without sound if the mixer fails to initialize, but for the full experience ensure your system audio is available.
- Move:
←/→orA/D - Shoot:
SPACE - Pause / Back:
ESC - Objective: Clear successive enemy waves to summon each stage boss. Defeat the boss to advance to the next language-themed arena.
- Double Shot: Temporarily fires an additional projectile with every attack.
- Shield: Surrounds the ship with a protective barrier against a hit.
- Slow Time: Slows incoming threats, giving breathing room to dodge.
- Keep moving horizontally to dodge barrages from bosses and spiraling projectiles.
- Time your shots to maximize damage windows when enemies change direction.
- Watch for keyword-labeled bullets—boss specials are faster and hit harder.
Stages live in the STAGES list within main.py. Duplicate an existing block and tweak:
name,color, and enemy grid (enemy_rows,enemy_cols).- Difficulty knobs (
enemy_speed,enemy_drop,enemy_shoot_chance,enemy_hp,player_projectile_speed). - Boss definition (
bossdict) with its HP, patterns, specials, and sprite. Remember to supply any custom sprites or icons inassets/.
- Enemy visuals: Update the
enemy_spritepath in a stage to use a custom image. - Boss patterns: Extend
Boss.fire_patternto add new attack types. Create a new branch in the method and append projectiles toenemy_bulletsfor your pattern.
Player.apply_power handles boosts. Add new cases and spawn them from PowerUp or wave logic to prototype unique mechanics (e.g., rapid fire or score multipliers).
- Store assets under
assets/to avoid load failures. - Reuse helper functions
try_load_imageandtry_load_soundto provide fallbacks when files are missing.
Stackinvaders/
├── assets/ # Sprites, audio, and sound effects
├── main.py # Game loop, entities, stage logic
├── README_EN.md # English guide
└── README_PT.md # Guia em português
Have fun hacking on Stack Invaders, and share your favorite language boss combos! 🚀