Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ grep -r 'opentui' web/src/ # Should find nothing
| Players | Lives | Alien Speed | Grid |
|---------|-------|-------------|------|
| 1 (solo) | 3 | 1.0× | 11×5 |
| 2 | 5 shared | 1.25× | 11×5 |
| 3 | 5 shared | 1.5× | 13×5 |
| 4 | 5 shared | 1.75× | 15×6 |
| 2 | 5 each | 1.25× | 11×5 |
| 3 | 5 each | 1.5× | 13×5 |
| 4 | 5 each | 1.75× | 13×6 |

### WebSocket Protocol

Expand Down
2 changes: 1 addition & 1 deletion Lessons_learned.md
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ const scaleTable = {
}
```

**Shared lives in co-op.** 5 lives shared across all players in co-op (vs 3 in solo). Any player death costs one shared life.
**Per-player lives in co-op.** Each player gets 5 lives in co-op (vs 3 in solo). `Player.lives` is the canonical counter — the game ends when all players are individually dead and out of lives.

**Spread spawn positions.** Players start evenly distributed across the screen width:

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Multiplayer Space Invaders clone (1–4 players) built with OpenTUI and Cloudflare Durable Objects. **Play in your terminal or your browser** — one authoritative server, two frontends, same game.

![Version: 1.1.0](https://img.shields.io/badge/version-1.1.0-blue)
![Version: 1.1.1](https://img.shields.io/badge/version-1.1.1-blue)
![Terminal Size: 120x36](https://img.shields.io/badge/terminal-120x36-blue)
![License: MIT](https://img.shields.io/badge/license-MIT-green)

Expand Down Expand Up @@ -61,7 +61,7 @@ TUI and browser players can share the same room. The server is authoritative at
## Game modes

- **Solo** — 3 lives, standard alien grid
- **Co-op** (2–4 players) — 5 shared lives, larger grid, faster aliens, per-player slot colours
- **Co-op** (2–4 players) — 5 lives each, larger grid, faster aliens, per-player slot colours

## Architecture

Expand Down
2 changes: 1 addition & 1 deletion bin/vaders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Usage:
vaders --local Run local server (default: remote)

Controls:
Arrow keys or A/D Move left/right
Arrow keys Move left/right
SPACE Shoot
ENTER Ready up / Select
Q Quit
Expand Down
20 changes: 10 additions & 10 deletions docs/server-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,23 +133,23 @@ Created (POST /room)
│ waiting │ ◄────────────────► │ countdown │
└─────────┘ all ready └───────────┘
│ │
│ start_solo │ 3...2...1...
│ start_solo │ 1s countdown
│ │
▼ ▼
┌───────────┐ ┌───────────┐
│ wipe_hold │ ◄───────────────┤ wipe_hold │
└─────┬─────┘ └───────────┘
│ hold complete (60 ticks)
│ hold complete (45 ticks)
┌──────────────┐
│ wipe_reveal │ aliens created with entering=true
└──────┬───────┘
│ reveal complete (120 ticks)
│ reveal complete (45 ticks)
┌─────────┐ wave complete ┌───────────┐
│ playing │ ──────────────────► │ wipe_exit │
└─────────┘ └─────┬─────┘
│ │ exit complete (60 ticks)
│ │ exit complete (45 ticks)
│ ▼
│ ┌───────────┐
│ │ wipe_hold │ ─── (loops back to wipe_reveal)
Expand Down Expand Up @@ -506,9 +506,9 @@ TICK │ playing │ playing/game_over
Wave transitions use a three-phase wipe animation controlled server-side:

```
wipe_exit (60 ticks / 2s) → iris closing animation
wipe_hold (60 ticks / 2s) → black screen with wave title
wipe_reveal (120 ticks / 4s) → iris opening, aliens enter with entering=true
wipe_exit (45 ticks / 1.5s) → iris closing animation
wipe_hold (45 ticks / 1.5s) → black screen with wave title
wipe_reveal (45 ticks / 1.5s) → iris opening, aliens enter with entering=true
```

During wipe phases, the `wipeTickReducer` counts down `wipeTicksRemaining` and
Expand Down Expand Up @@ -566,9 +566,9 @@ Game difficulty scales with the number of players:
| Players | Lives | Alien Speed | Grid Size | Alien Shots/s |
|---------|-------|-------------|-----------|---------------|
| 1 (solo) | 3 | 1.0x | 11x5 | 0.5 |
| 2 | 5 shared | 1.25x | 11x5 | 0.75 |
| 3 | 5 shared | 1.5x | 13x5 | 1.0 |
| 4 | 5 shared | 1.75x | 15x6 | 1.25 |
| 2 | 5 each | 1.25x | 11x5 | 0.75 |
| 3 | 5 each | 1.5x | 13x5 | 1.0 |
| 4 | 5 each | 1.75x | 13x6 | 1.25 |

### Player Spawn Positions

Expand Down
Loading