A classic Space Invaders game with on-chain state powered by Soroban smart contracts on the Stellar network.
Play Space Invaders - Classic arcade gameplay in your browser
Zero Friction - No wallet installation or setup required
Embedded Wallet - Auto-generated wallet stored locally (testnet auto-funded)
On-chain Game State - Game logic runs on Stellar Soroban
ECS Architecture - Uses cougr-core Entity-Component-System framework
Premium UX - Modern dark theme with neon glow effects
Component
Technology
Smart Contract
Soroban (Rust) + cougr-core ECS
Frontend
Vite + TypeScript
Wallet
Embedded (auto-generated, localStorage)
Network
Stellar Testnet (auto-funded)
├── contracts/game/ # Soroban smart contract
│ └── src/
│ ├── lib.rs # Contract entry points
│ ├── game_state.rs # ECS components
│ └── test.rs # Unit tests (13 tests)
├── frontend/ # Web game client
│ └── src/
│ ├── main.ts # Entry point
│ ├── game.ts # Game logic
│ ├── contract.ts # Stellar SDK calls
│ └── styles.css # Modern UI
├── scripts/ # Deployment & automation
│ ├── setup-repo.sh # GitHub CLI setup
│ └── deploy-testnet.sh # Testnet deployment
├── .github/workflows/ # CI/CD
│ └── ci.yml
└── docs/ # Documentation
# Clone the repository
git clone https://github.com/JafetCHVDev/space-invaders-game.git
cd space-invaders-game
# Add wasm32 target
rustup target add wasm32-unknown-unknown
cargo build --target wasm32-unknown-unknown --release
# Setup identity (first time only)
stellar keys generate --global deployer --network testnet
stellar keys fund deployer --network testnet
# Deploy contract
./scripts/deploy-testnet.sh
cd frontend
npm install
npm run dev
Open http://localhost:5173
Function
Parameters
Description
init_game
-
Initialize new game
move_ship
direction: i32
Move ship (-1=left, 1=right)
shoot
-
Fire bullet
update_tick
-
Advance game state
Function
Returns
Description
get_score
u32
Current score
get_lives
u32
Remaining lives
get_ship_position
i32
Ship X position
get_active_invaders
u32
Invader count
check_game_over
bool
Game over status
Key
Action
←
Move left
→
Move right
Space
Shoot
Fork the repository
Create your feature branch (git checkout -b feature/amazing)
Commit changes (git commit -m 'Add amazing feature')
Push to branch (git push origin feature/amazing)
Open a Pull Request
Setup GitHub Labels & Issues
# After configuring gh cli
./scripts/setup-repo.sh
MIT License - see LICENSE
Built with 💜 for the Stellar ecosystem