Skip to content

Santoshkrishna-code/Space-Strike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Space-Strike

A Modern Space Invaders Clone - Pure Python + Pygame with HD graphics, progressive difficulty, and complete gameplay polish.

Version: 1.0.0 (April 14, 2026)


Overview

Space-Strike is a feature-complete arcade game inspired by the classic Space Invaders. It combines retro gameplay mechanics with modern quality-of-life features:

  • 15+ Progressive Waves with increasing difficulty
  • Difficulty Modes (Easy, Normal, Hard) that scale gameplay
  • HD Graphics at 1280x800 with modern card-based UI
  • Generated Audio with harmonic synthesis fallback
  • Persistent Settings saved to JSON
  • Accurate Game Timer that excludes paused time
  • Windows EXE Build ready to distribute

Quick Start

Option 1: Run from Source

git clone https://github.com/Santoshkrishna-code/Space-Strike.git
cd Space-Strike

python -m venv .venv
.\.venv\Scripts\activate  # Windows
source .venv/bin/activate # macOS/Linux

pip install -r requirements.txt
python main.py

Option 2: Download Windows EXE

Direct download: Space-Strike.exe

Simply download and run - no Python installation needed.

Or visit the Releases page for version history.


๐ŸŽฎ Controls

Action Key(s)
Move Left/Right โ† โ†’ Arrow Keys
*Controls
Action Key
Move Left/Right Left/Right Arrow Keys
Shoot Spacebar
Open Settings S
Pause/Resume P
Start Game Enter (from menu)
RFeatures

Gameplay

  • Wave Progression: Aliens increase in count and speed every 2 waves
  • Destructible Shields: 4 shields with hit damage tracking
  • Alien Bombs: Random bomb drops that increase per wave
  • Mystery Ship: Bonus points for eliminating the UFO
  • Combo System: Consecutive hits without damage boost score multiplier
  • Grace Period: 3.2s protection at wave start (scales with difficulty)

Mechanics

  • Staged Descent Animation: Frame-based movement with column stagger
  • Wave-Based Scaling:
    • Alien horizontal speed (0.72 to 1.25 px/frame across waves)
    • Bomb drop chance (0.5% to 5% per frame)
    • Drop distance (10 to 22 pixels)
    • Animation speed (1.8 to 4.4 px/frame)
    • Descent stagger delays (3 frames to 1 frame)

Settings

  • Difficulty Modes: Easy (slower aliens, more grace), Normal (baseline), Hard (faster aliens, more bombs)
  • Audio Mixer: Independent Master, Music, SFX sliders (0-100%)
  • Persistent Profile: Auto-saves to user_settings.json

User Interface

  • Card-Based HUD: 4-panel layout (Score/Hi, Wave/Time, Combo/Difficulty, Lives)
  • Centered Menu: Modern design with star background
  • Settings Panel: Row-based navigation with visual feedback
  • Playfield Frame: Side rails for visual structure
  • Time Display: MM:SS format, paused-time excluded

Audio

  • Fallback Synthesis: All SFX procedurally generated if assets missing
  • Harmonic Layering: Multi-frequency tones for richer sound
  • Volume Controls: Per-channel mixing in settings

Project Structure

Space-Strike/
|-- main.py                 Entry point
|-- game.py                 Game loop, state machine, wave logic
|-- settings.py             Global constants and config
|-- __version__.py          Version metadata
|-- requirements.txt        Pip dependencies
|-- main.spec               PyInstaller specification
|-- README.md               This file
|
|-- core/                   Game mechanics
|   |-- __init__.py
|   |-- player.py           Player sprite, movement, shooting
|   |-- alien.py            Alien fleet, bombs, descent logic
|   |-- bullet.py           Player bullets
|   |-- bomb.py             Alien bombs
|   |-- base.py             Destructible shields
|   |-- collision.py        Collision detection
|
|-- ui/                     User interface
|   |-- __init__.py
|   |-- hud.py              In-game HUD (score, timer, waves)
|   |-- menu.py             Main menu screen
|   |-- game_over.py        Game over screen
|   |-- settings_menu.py    Settings/options screen
|   |-- button.py           UI button component
|
|-- utils/                  Utilities
|   |-- __init__.py
|   |-- asset_loader.py     Image/sound/font loading + synthesis
|   |-- helpers.py          Utility functions
|
|-- assets/                 Game assets (optional)
|   |-- fonts/              .ttf font files
|   |-- images/             .png sprite sheets
|   |-- sounds/             .wav audio files
|
|-- build/                  PyInstaller build artifacts
    |-- main/               Intermediate build files

Tech Stack

Component Technology Version
Language Python 3.12.6+
Game Engine Pygame 2.6.1+
Audio Synthesis struct + wave modules Python stdlib
Bundler PyInstaller 6.19.0+
VCS Git + GitHub Latest

Gameplay Progression

Wave Scaling

Each wave introduces gradually increasing challenge:

Metric Wave 1 Wave 5 Wave 10 Wave 15
Alien Grid 3x7 4x9 5x11 5x11
Horizontal Speed 0.72 px/f 1.04 px/f 1.25 px/f 1.25 px/f
Bomb Chance 0.5% 1% 2% 2.5%
Drop Distance 10 px 14 px 18 px 22 px
Drop Speed 1.8 px/f 2.6 px/f 3.4 px/f 4.4 px/f

Difficulty Multipliers

Easy Mode:

  • Alien speed: 0.7x
  • Bomb spawn chance: 0.5x
  • Grace period: +4.8s (vs 3.2s base)
  • Max bombs: 0.7x

Normal Mode:

  • Baseline (no multiplier)

Hard Mode:

  • Alien speed: 1.3x
  • Bomb spawn chance: 1.5x
  • Grace period: 0.5x (1.6s)
  • Max bombs: 1.3x

Configuration

All game settings are stored in user_settings.json (auto-created on first launch):

{
  "difficulty": "normal",
  "master_volume": 0.9,
  "music_volume": 0.35,
  "sfx_volume": 0.8
}

Edit this file to change defaults, or use the in-game Settings menu (press S Edit this file to change defaults, or use the in-game Settings menu (press S).


Building the EXE

To create a standalone Windows executable:

pip install pyinstaller

pyinstaller main.spec --clean

Output: dist/Space-Strike.exe

The EXE bundles Python, all dependencies, and game assets into a single ~150MB executable without Python installation required The EXE bundles Python, all dependencies, and game assets into a single ~150MB executableโ€”no installation required for end users.


๐ŸŽฏ Scoring System

Scoring

  • Alien Kill: 10 points (row 1) to 40 points (row 3)
  • Shield Block: +1 hit durability tracked
  • Mystery Ship: 100-300 bonus points (random)
  • Combo Multiplier: +10% per consecutive hit (resets on damage

๐Ÿ› Known Limitations

  • *Known Limitations

  • Windows Only: EXE build via PyInstaller is Windows-specific. macOS/Linux users must run from source.

  • Fullscreen Not Implemented: Run in windowed mode only.

  • No Mouse Support: All navigation is keyboard-based.

  • Asset Dependencies Optional: Game generates audio and

๐Ÿค Contributing

FouContributing

Found a bug or have a feature request? Open an Issue or submit a Pull Request.

Development Setup:

git clone https://github.com/Santoshkrishna-code/Space-Strike.git
cd Space-Strike
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txt
pip install pyinstaller

python main.py


---

## ๐Ÿ“ License

This project is licensed under the **MIT License**. See [LICENSE](LICENSE) for details.

---
License

This project is licensed under the MIT License. See LICENSE
### Version 1.0.0 (April 14, 2026)
- โœจChangelog

### Version 1.0.0 (April 14, 2026)
- Initial release
- Complete gameplay loop with 15+ waves
- Difficulty settings and persistent profile
- Modern HD UI (1280x800) with card-based HUD
- Fallback audio synthesis system
- Windows EXE packaging
- Accurate in-game timer and stats
-
## ๐Ÿ™ Credits

Built with โค๏ธ using **[Pygame](https://www.pygame.org/)** and **[PyInstaller](https://pyinstaller.org/)**.
Credits

Built with Pygame and PyInstaller.

Inspired by the classic arcade game Space Invaders (1978).

## Support

For questions or issues, please open a GitHub Discussion or contact the maintainer.

Play Space-Strike now and climb the leaderboard!
โ”œโ”€โ”€ ui/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ button.py
โ”‚   โ”œโ”€โ”€ game_over.py
โ”‚   โ”œโ”€โ”€ hud.py
โ”‚   โ””โ”€โ”€ menu.py
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ asset_loader.py
โ”‚   โ””โ”€โ”€ helpers.py
โ”œโ”€โ”€ assets/
โ”‚   โ”œโ”€โ”€ fonts/
โ”‚   โ”‚   โ””โ”€โ”€ arcade.ttf
โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ”‚   โ”œโ”€โ”€ alien1.png
โ”‚   โ”‚   โ”œโ”€โ”€ alien2.png
โ”‚   โ”‚   โ”œโ”€โ”€ alien3.png
โ”‚   โ”‚   โ”œโ”€โ”€ background.png
โ”‚   โ”‚   โ”œโ”€โ”€ base.png
โ”‚   โ”‚   โ”œโ”€โ”€ bomb.png
โ”‚   โ”‚   โ”œโ”€โ”€ bullet.png
โ”‚   โ”‚   โ”œโ”€โ”€ explosion.png
โ”‚   โ”‚   โ””โ”€โ”€ player.png
โ”‚   โ””โ”€โ”€ sounds/
โ”‚       โ”œโ”€โ”€ alien_move.wav
โ”‚       โ”œโ”€โ”€ background_music.mp3
โ”‚       โ”œโ”€โ”€ explosion.wav
โ”‚       โ”œโ”€โ”€ game_over.wav
โ”‚       โ””โ”€โ”€ shoot.wav
โ””โ”€โ”€ build/

UI/UX Design Included

  • Menu screen with animated starfield and blinking prompt.
  • Top HUD bar showing score and remaining lives.
  • Retro color palette and arcade font.
  • Semi-transparent game-over overlay with final score.
  • Smooth state transitions: menu -> playing -> game over -> restart.

Sound Design Included

  • shoot.wav: player bullet fire
  • explosion.wav: alien/mystery explosion
  • alien_move.wav: fleet edge-drop movement cue
  • game_over.wav: player death/game over cue
  • background_music.mp3: looping background track

If sound/font/image files are missing or invalid, safe fallbacks are used so gameplay still works.

Build Windows EXE (with Assets)

Use this command so images/sounds/fonts are bundled correctly:

pyinstaller --onefile --noconsole --add-data "assets;assets" main.py

Output:

  • dist/main.exe

Publish Windows EXE on GitHub (Recommended)

Do not commit large EXE binaries to source folders. Use GitHub Releases:

  1. Push source code to GitHub.
  2. Build EXE locally.
  3. Create release tag (example: v1.0.0).
  4. Upload dist/main.exe as a release asset.
  5. Share the release URL for download.

Complete Prompt You Can Reuse

Use this prompt with ChatGPT/Copilot to regenerate or extend the game:

Build a complete, fully playable 2D Space Invaders desktop game using Python and Pygame.

Requirements:
- Player ship at bottom moves left/right only.
- Player shoots bullets upward with SPACE.
- Alien grid (5 rows x 11 columns) moves horizontally as one group.
- On edge hit: aliens move down, reverse direction, and slightly increase speed.
- Aliens can be destroyed individually.
- Aliens randomly drop bombs downward.
- Add destructible shield bases between player and aliens.
- Collision handling for:
  - player bullets vs aliens
  - alien bombs vs player
  - bullets/bombs vs shields
- Player starts with 3 lives.
- Game over when lives are zero or aliens reach bottom.
- Score increases when aliens are destroyed.
- UI states: start menu, playing, game over, restart option.
- Display score and lives in HUD.
- Include mystery ship bonus target.
- Add sound effects and looping background music.
- Organize code into modules:
  - main.py, game.py, settings.py
  - core/: player, alien, bullet, bomb, base, collision
  - ui/: menu, hud, game_over, button
  - utils/: asset_loader, helpers
- Keep code clean, readable, class-based, and extendable.
- Provide run instructions and Windows build instructions.
- Build command must include assets:
  pyinstaller --onefile --noconsole --add-data "assets;assets" main.py

Output complete runnable code.

About

A complete Space Invaders arcade game built with Python and Pygame. Download the Windows EXE or run from source.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages