Skip to content

drewpost/space-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Eddie Space Runner - Browser Game

A Pygame space shooter game that runs in the browser via WebAssembly!

Quick Start (Local Testing)

Prerequisites

  • Python 3.10+
  • pip

Build Steps

  1. Install Pygbag:

    pip install pygbag
  2. Navigate to the game folder:

    cd eddie-space-runner
  3. Build and test locally:

    pygbag --build main.py

    This will:

    • Create a build/web/ folder with all the WebAssembly files
    • Start a local server at http://localhost:8000
    • Open your browser automatically
  4. Test the game at http://localhost:8000


Deploy to GitHub Pages

Step 1: Create GitHub Repository

  1. Go to github.com/new
  2. Name it something like eddie-space-runner or space-game
  3. Make it Public
  4. Click Create repository

Step 2: Build the Game

On your local machine:

# Install pygbag if you haven't
pip install pygbag

# Navigate to your game folder
cd eddie-space-runner

# Build for web (without starting server)
pygbag --build main.py

Step 3: Prepare Files for GitHub

After building, your folder structure should look like:

eddie-space-runner/
├── index.html          ← Landing page
├── main.py             ← Source code
├── README.md
└── build/
    └── web/
        ├── index.html  ← Pygbag loader
        ├── favicon.png
        └── ... (wasm files, etc.)

Step 4: Push to GitHub

# Initialize git (if not already)
git init

# Add all files
git add .

# Commit
git commit -m "Initial commit - Eddie Space Runner"

# Add your remote (replace YOUR_USERNAME)
git remote add origin https://github.com/YOUR_USERNAME/eddie-space-runner.git

# Push
git push -u origin main

Step 5: Enable GitHub Pages

  1. Go to your repository on GitHub
  2. Click Settings (tab at the top)
  3. Scroll down to Pages (left sidebar)
  4. Under Source, select:
    • Branch: main
    • Folder: / (root)
  5. Click Save

Step 6: Access Your Game! 🎮

After a minute or two, your game will be live at:

https://YOUR_USERNAME.github.io/eddie-space-runner/

Game Controls

Action Key
Move Arrow Keys (↑↓←→)
Shoot Up W
Shoot Down S
Shoot Left A
Shoot Right D
Open Shop TAB
Buy Items Number Keys (1-8)
Close Shop SPACE or ESC

Shop Items

# Item Cost Effect
1 Heal 10 gems +25 health
2 Speed 20 gems +1 movement speed
3 Shield 15 gems Protective shield
4 Shield Size 15 gems Larger shield
5 Shield Damage 15 gems Shield hurts enemies
6 Drone 30 gems Auto-targeting drone
7 Extra Drone 20 gems Additional drone
8 Drone Damage 20 gems +10 drone damage

Troubleshooting

Game doesn't load?

  • Make sure you've run pygbag --build main.py successfully
  • Check that build/web/ folder exists with files
  • Clear browser cache and try again

"SharedArrayBuffer" error?

  • This is a browser security feature
  • GitHub Pages should handle this automatically
  • If testing locally, use pygbag main.py (starts proper server)

Black screen?

  • Click anywhere on the game canvas first (browser policy)
  • Press SPACE to start

Performance issues?

  • Try Chrome or Firefox (best WebAssembly support)
  • Close other tabs
  • Reduce browser zoom to 100%

Project Structure

eddie-space-runner/
├── main.py              # Game source (Pygame + asyncio)
├── index.html           # Nice wrapper page
├── README.md            # This file
└── build/web/           # Generated by Pygbag
    ├── index.html       # Pygbag's loader
    ├── main.py          # Copy of your game
    ├── *.wasm           # WebAssembly binary
    └── *.js             # JavaScript glue code

Tips for Customization

Change game size

In main.py, modify:

WIDTH = 1200   # Change width
HEIGHT = 800   # Change height

Then update index.html iframe dimensions to match.

Add sounds

Place .ogg files in the same folder as main.py and load with:

sound = pygame.mixer.Sound("sound.ogg")
sound.play()

Add images

Place .png files in the same folder and load with:

img = pygame.image.load("sprite.png")

License

Free to use and modify! Have fun! 🚀

Build trigger Tue Jan 6 20:48:41 UTC 2026

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors