opencode-tetris-battleMultiplayer Tetris Battle plugin for OpenCode TUI
0
192
近 7 天 1
28.3
生态多维模型
3 个月前
2026-05-02
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-tetris-battle@1.0.46"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-tetris-battle@1.0.46"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-tetris-battleopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
Multiplayer Tetris Battle for the OpenCode TUI.
Play side-by-side terminal Tetris with live opponent boards, garbage attacks, private room codes, and quick matchmaking. The game uses a hosted Convex backend for rooms, reactive board sync, attacks, and match results.
Install
opencode plugin opencode-tetris-battle@latest --global
Restart OpenCode, then run:
/tetris-battle
Upgrade
bunx opencode-tetris-battle upgrade
Restart your OpenCode TUI session afterwards.
Play
Matchmaking
- Open
/tetris-battlein two OpenCode windows. - Press
Min both windows. - Press
Rin both windows when paired.
Private room
- Host presses
Nto create a numeric room code. - Guest presses
J, types the room code, then presses Enter. - Both players press
Rto ready.
Controls
Splash:
- Any key enters the lobby.
Qcloses the dialog.
Lobby:
Ncreates a private room.Jenters room-code typing mode (4 numeric digits).Enterjoins the typed room code.Mstarts matchmaking.Rtoggles ready.Qopens the quit confirm; pressQagain to confirm orEscto cancel.
Room (waiting / countdown):
Rtoggles ready.Lopens the leave-to-lobby confirm; pressLagain to confirm orEscto cancel.Qopens the quit confirm.
Game:
←/Amoves left.→/Dmoves right.↑/Wrotates.↓/Ssoft drops.Spacehard drops.Cholds.Ppauses.Lreturns to the lobby (double-press to confirm).Qquits (double-press to confirm).
Pause:
Presumes — onlyP,L, andQdo anything while paused; other keys are ignored.Lopens the leave-to-lobby confirm.Qopens the quit confirm.
Match over:
Rrematches in the same room.Lreturns to the lobby.Qquits.
Hosted backend
The plugin works out of the box with the public hosted Tetris Battle backend.
Development
bun install
bun run typecheck
bunx convex dev --once --typecheck=disable
License
MIT