尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证blobs-game
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗A multiplayer trick-calling card game for phones, built with Next.js and ready to host on Vercel.
Everyone says up front how many tricks they'll win. Then you play it out: follow suit, highest card wins, trumps beat everything. Hit your call exactly and you score it. Miss — over or under — and you're blobbed (−1).
Play vs CPU on the home screen deals you in against three computer players, each set to Easy, Normal or Hard. The game runs entirely in your browser (no server or Redis involved), saves after every move, and can be resumed from the home screen.
The bots only know what a human at the table could: their own hand, the trump, the calls and the cards played so far.
| Level | How it plays |
|---|---|
| Easy | Calls from a rough high-card count with some noise, plays sensibly but not carefully, and occasionally throws a random card. |
| Normal | Counts cards and infers who is out of which suit. Estimates each card's chance of winning, calls the number of tricks it's most likely to hit exactly, then plays whichever card gives the best chance of finishing on that number. |
| Hard | For every call and card it considers, deals the unseen cards out at random (respecting known voids), plays the rest of the round against Normal opponents, and picks the option with the best average score. Runs in a Web Worker for about 0.4s per move. |
The AI lives in lib/ai/ as pure functions and the local game controller is in lib/solo/. To check relative strength, run TOURNAMENT=1 npx vitest run lib/ai/ai.test.ts (set GAMES, ROWS and BUDGET to taste). In a 120-game run Hard hit its call 64% of the time against three Normal bots (Normal hits about 43%) and won the game 56% of the time, where 25% would be even.
npm install
npm run dev
Open http://localhost:3000. With no Redis configured, game state is held in memory, which is fine for one dev server. To test with friends on your network, open http://<your-ip>:3000 on their phones.
npm test # rules engine tests
npm run lint
npm run typecheck
npm run build
WEBDIS_URL pointing at your Webdis instance, e.g. https://webdis.example.com/. If it uses HTTP basic auth, also set WEBDIS_USERNAME and WEBDIS_PASSWORD (sent as the Authorization header). Webdis must allow GET and EVAL.
If Webdis is behind Cloudflare Access, create a service token and set CF_ACCESS_CLIENT_ID and CF_ACCESS_CLIENT_SECRET; they are sent as the CF-Access-Client-Id / CF-Access-Client-Secret headers. WEBDIS_HEADERS (a JSON object) can add any other headers.Redis (via Webdis) is required in production: serverless functions don't share memory, so without it players would land on different instances and see different games. Rooms expire 24 hours after their last change.
| Piece | Where |
|---|---|
| Rules engine: dealing, calling, trick winner, scoring, state machine. Pure functions, no I/O. | lib/game/ |
| Room storage with optimistic concurrency (Redis Lua compare-and-set over Webdis, or in-memory) | lib/server/store.ts |
| API: create / join / poll / act | app/api/rooms/ |
| Polling + actions hook | lib/client/useRoom.ts |
| UI | components/, app/ |
The original version used Socket.IO and a single in-memory game. Vercel functions can't hold WebSocket connections or share memory, so this version instead stores each room in Redis and clients poll GET /api/rooms/:code?v=<version> about once a second. If nothing changed the server answers with a tiny { unchanged: true }. Actions are POST /api/rooms/:code/action, validated by the engine, and each player only ever receives their own hand.
The "next round" timer and trick resolution are modelled as game state rather than server timeouts (which can't exist on serverless): a finished trick stays on the table until the winner leads, and the recap advances when everyone taps continue or when its countdown expires.