A TetriNET 2-inspired multiplayer Tetris game built with Odin and Raylib.
- Full TetriNET 2 gameplay with all special blocks (Add Line, Nuke, Gravity, etc.)
- 6-player multiplayer support
- Standalone server (runs in Docker or locally)
- Windows client with modern graphics via Raylib
- TDD-focused development with comprehensive test suite
natrinet/
├── client/ # Raylib-based graphical client
├── server/ # Headless game server
├── shared/ # Common code (protocol, game types)
├── tests/ # Unit and integration tests
├── .claude/ # Claude Code configuration
│ ├── commands/ # Slash commands (/test, /build, etc.)
│ └── agents/ # Domain-specific subagents
├── build.bat # Windows build script
├── build.sh # Linux/Mac build script
└── docker-compose.yml
- Odin compiler (dev branch recommended)
- Raylib 5.0+ (for client)
- Docker (optional, for server deployment)
# Windows
build.bat all debug
# Linux/Mac
./build.sh all debug# Terminal 1: Start server
./build/natrinet-server --port 31457 --debug
# Terminal 2: Start client
./build/natrinet-client --server localhost:31457 --name "Player1"# Build and start server
docker-compose up -d natrinet-server
# Connect client
./build/natrinet-client --server localhost:31457This project uses Claude Code for AI-assisted development. Key commands:
/test- Run test suite/build- Compile client and server/run-server- Start the game server/run-client- Start the game client/lint- Check code quality
Write tests first:
@(test)
test_piece_rotation :: proc(t: ^testing.T) {
piece := create_piece(.T)
rotated := rotate_cw(piece)
testing.expect_value(t, rotated.rotation, 1)
}Then implement:
odin test tests/unit| Key | Action |
|---|---|
| ←/→ | Move piece |
| ↑ | Rotate clockwise |
| Z | Rotate counter-clockwise |
| ↓ | Soft drop |
| Space | Hard drop |
| C | Hold piece |
| 1-6 | Use special on player |
| Enter | Send chat |
| Esc | Menu / Quit |
| Block | Name | Effect |
|---|---|---|
| A | Add Line | Adds garbage line to opponent |
| C | Clear Line | Clears your bottom line |
| N | Nuke | Clears your entire field |
| R | Random Clear | Clears 10 random blocks |
| S | Switch | Swaps fields with opponent |
| B | Block Bomb | Explodes surrounding blocks |
| G | Gravity | All blocks fall down |
| Q | Quake | Shifts lines randomly |
| O | Block Quake | Scatters blocks |
MIT