I'm building 黑白棋 (Reversi) as a polished arcade experience — "Reversi Noire": emerald felt, obsidian & pearl stones, gold accents, with vs-CPU AI (3 difficulties) and local 2P, synthesized sound, particles, screen shake, and local high scores. First, let me install icons and set up the foundation.
Now the game engine (rules + AI), the synthesized audio engine, and the high-score storage — plus the full visual theme CSS. These are independent, so I'll create them together.
Minor type issues in the engine (-color widens to number). Let me rewrite it cleanly with a typed opp() helper.
Found it — a real bug in the medium AI (double-indexing). Fixing now.
Engine is clean. Now the full visual theme — fonts, felt board texture, glossy 3D discs, and every animation keyframe.
Now the two biggest visual pieces: the canvas particle system and the interactive board.
Now all the UI screens — start menu with high-score table, HUD, pause, and game-over overlays.
Quick fixes: wire the restart button into the HUD cluster and drop the unused diff prop.
Both fixed. Now the heart of the app — App.tsx with the full game loop, juice systems (shake, particles, popups), keyboard/touch controls, AI scheduling, and state machine.
Fixing the two issues — add busy/thinking to the state mirror and remove dead code.
Now let me clean up the leftover humanScoring dead code in the scoring block.
Now let's build to verify everything compiles.
Build passes. Let me harden two gameplay details: a synchronous move lock (prevents same-tick double placement) and smarter Enter/Space placement that snaps to a legal square.
Now the unlock paths — proceed, endGame, startGame, and quit.
Now the tighter keyboard placement — Enter always snaps to a legal square.
Two layout robustness fixes: prevent HUD clipping on short landscape screens (grid centering instead of flex justify-center), and make the start screen use min-h-dvh directly.
I need to close the new inner wrapper div. Let me view that section.
Let me do a full review pass of the final App to catch any remaining logic issues.
Everything checks out. One tiny cleanup in the HUD plate, then the final build.
黑白棋 · Reversi Noire is built and shipping clean. Here's what's in the game:
Core Loop (fun in 10 seconds)
Classic 8×8 Othello rules with instant legal-move hints, and every placement is an event: stones pop in with a squash-spring, flipped discs cascade outward as a 3D domino coin-wave, and the first move already pays out a floating +300 score popup with particle sparks.
The Juice
- Screen shake — spring-decayed, scaled by flip count (4+ flips rattle, 8+ slams), firing confetti bursts on victory
- Canvas particle system — additive gold/pearl sparks synced to each flip, impact ripples, corner-capture starbursts, win confetti; rAF loop sleeps at zero particles
- Synthesized audio — no assets: wooden stone "thock", rising pitch-ladder flip sweeps per combo, golden corner pings, win arpeggios; mute persisted
- Combo system — consecutive 4+ flip moves build 连锁 multipliers with tier popups (妙手! → 绝妙! → 神之一手!!)
Complete Game States
- Start screen — floating 3D coins, difficulty select (初段/中段/名人), vs-CPU or local 2P, high-score board
- AI — random (easy), greedy positional (medium), alpha-beta negamax with ordering that solves endgames exactly (hard)
- Pause — P/Esc, freezes AI timers and reconciles cleanly on resume
- Game over — slam-in result word, NEW RECORD badge, stats, instant
R restart
- Local high scores — top-10 with difficulty multiplier (×1/×1.5/×2), stored in localStorage
Controls & Performance
Arrows/WASD + Enter/Space/Z to play, P pause, R restart, M mute — Enter auto-snaps to a legal square; touch gets pointer-down response with ghost previews, no 300ms delay. Rendering is transform-only (3D CSS coins, rAF shake, canvas FX), DPR-capped particles, and a ~90KB gzipped single file — smooth 60fps on desktop and mobile.
Files built: index.html, src/game/engine.ts, src/game/audio.ts, src/game/storage.ts, src/index.css, src/components/Particles.tsx, src/components/Board.tsx, src/components/Screens.tsx, src/App.tsx