Skip to content

dubzn/starkbound

Repository files navigation

Starkbound

demo

Turn-based artillery on Starknet — a love letter to GunBound, rebuilt on-chain.

2–4 players take turns aiming and firing across a destructible Metamine terrain map. Wind shifts every round. Last tank standing wins. All game logic lives on-chain.


What Makes Starkbound Different

In Starkbound, the chain is the game engine:

  • Physics trajectories computed in Cairo
  • Damage with proximity falloff validated on-chain
  • Wind generated via Poseidon RNG, stored per turn
  • Terrain destruction written as TerrainRow bitmap models
  • Victory conditions checked by the contract after every shot

The client is a rendering layer — not a logic layer. The authoritative result always comes from the chain.


On-Chain Architecture

Component Implementation
Game & lobby state GameState, Lobby, Player Dojo models
Per-tank state TankState model (hp, shield, position, alive)
Physics simulation Trajectory calculation in Cairo (helpers/physics.cairo)
Damage calculation Proximity falloff computed on-chain
Terrain destruction TerrainRow bitmap model — craters written per shot
Wind system Poseidon RNG seeded per turn, stored in GameState
Turn management current_slot and phase tracked on-chain
Victory condition alive flags checked after every shot
Shot validation All shots validated by the contract before state update

Stack: Dojo 1.7.2 / Cairo 2.13.1 — contracts in contracts/, client in client/ (React + Vite + TypeScript + starknet.js v8).


How to Play

Menu

The main menu has three panels:

  • Profile — create a burner wallet and enter your pilot name
  • Create Room — host or join a multiplayer lobby
  • Tutorial — learn the game solo vs. a bot (fully off-chain, no wallet needed)

Tutorial Mode

Tutorial mode walks new players through the core mechanics step by step:

  1. Moving your tank into position
  2. Panning the camera (click and drag)
  3. Adjusting shot angle
  4. Charging and firing
  5. Accounting for wind
  6. Completing a match vs. the Ice bot

No lobby, no contract calls — instant access, BGM included.

Multiplayer Game Flow

  1. Create a burner wallet from the Profile panel
  2. Enter your pilot name and spawn your player
  3. Open Create Room — host a lobby or join with a room code
  4. Select your tank:
    • Armor — high HP, balanced stats
    • Ice — slows terrain on impact
    • Lightning — chain damage that arcs to nearby tanks
  5. Once all players mark ready, the host starts the game
  6. On your turn: move, pan the camera (click and drag), set angle, read the wind compass, charge and fire
  7. Last tank standing wins — results shown in the end-game overlay

Slot Deployment

Requirements: slot

# Authenticate
slot auth login

# 1. Create Katana (epic tier, standalone with dev accounts)
slot deployments create starkbound -t epic katana --config katana_slot.toml

# 2. Deploy contracts against the slot katana RPC
#    Get the RPC endpoint from: slot deployments describe starkbound katana
sozo migrate --profile slot

# 3. Create Torii pointing to the slot katana
#    Fill in rpc and world_address in torii_slot.toml first
slot deployments create starkbound -t epic torii --config torii_slot.toml

torii_slot.toml:

rpc = "https://api.cartridge.gg/x/<project>/katana"
world_address = "<world_address>"

[indexing]
allowed_origins = ["*"]
transactions = true
contracts = [
  "erc20:0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", # ETH
  "erc20:0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", # STRK
]

[events]
raw = true

Local Dev Setup

Requirements: Dojo 1.7.2, Scarb 2.13.1, Node.js

# Terminal 1 — local chain
make katana

# Terminal 2 — indexer
make torii

# Terminal 3 — deploy contracts
make setup

# Terminal 4 — client
cd client && npm install && npm run dev

Open http://localhost:3000.

Copy .env.local.example to .env.local and fill in the Katana dev master account address and private key.


Game Jam

Starkbound was built as part of Game Jam N8, organized by Cartridge.


Team

@dub_zn + Codex + Claude


Starkbound is a tribute to Gunbound. All visual assets used in this project are property of Softnyx Co., Ltd. and are not original works of this project's author. This is a non-commercial fan project built for learning and competition purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors