How peotrannnn/bloc works
Bloc is a Vietnamese-language, browser-based 3D Quoridor variant. A player selects a move or wall through the game interface; the app validates and applies turns, schedules AI when appropriate, and refreshes the board and review display. The repository also contains an online server path for room creation, matchmaking, and authoritative multiplayer turns. The graph preserves the documented AI, rendering, evaluation, and server capabilities; some connections are omitted where the sampled excerpts do not establish them.
Main entry points: app.js Game coordinator · index.js HTTP and WebSocket entry · room.js Room Durable Object · lobby.js Matchmaking lobby
Components 29
Browser game
- Game coordinator
js/app.js - Input handling
js/input.js - Game interface
js/ui.js - 3D board stage
js/view/stage.js - Pawn rendering
js/view/pawns.js - Wall rendering
js/view/walls.js - Camera controls
js/view/camera.js - Board badges
js/view/badges.js - Win effects
js/view/fireworks.js - Game menu
js/menu.js
AI opponents
- AI strategy collection
js/ai - AI worker
js/ai/worker.js - Worker AI source
js/ai/worker-src.js
Game logic
- Shared rules engine
js/core.js - Client rules adapter
js/rules.js - Game state
js/state.js
Online play
- Online client
js/online-client.js - HTTP and WebSocket entry
server/src/index.js - Room codes
server/src/codes.js - Request limiter
server/src/limiter.js - Matchmaking lobby
server/src/lobby.js - Lobby matching logic
server/src/lobby-logic.js - Room Durable Object
server/src/room.js - Room game authority
server/src/room-logic.js
Review and evaluation
- Position evaluation
js/eval.js - Move review
js/review.js
Other components
- Player
- Browser client
- Cloudflare Worker
Connections 30
- Player → Input handling: provides actions
- Input handling → Game coordinator: dispatches input
js/app.js - Game coordinator → AI strategy collection: selects strategy
js/app.js - Game coordinator → AI worker: requests decisions
js/app.js - Game coordinator → Game interface: renders interface
js/app.js - Game coordinator → 3D board stage: updates board
js/app.js - Game coordinator → Wall rendering: updates walls
js/app.js - Game coordinator → Pawn rendering: updates pawns
js/app.js - Game coordinator → Camera controls: controls view
js/app.js - Game coordinator → Board badges: updates badges
js/app.js - Game coordinator → Win effects: plays win effects
js/app.js - Game coordinator → Move review: updates review
js/app.js - Game menu → Game coordinator: starts game
- Client rules adapter → Shared rules engine: adapts rules
README.md - Game coordinator → Client rules adapter: uses client rules
- Game coordinator → Game state: updates state
- AI worker → Worker AI source: runs worker source
- Move review → Position evaluation: evaluates positions
- Browser client → Online client: uses online play
- Cloudflare Worker → HTTP and WebSocket entry: routes requests
server/src/index.js - HTTP and WebSocket entry → Room codes: validates codes
server/src/index.js - HTTP and WebSocket entry → Request limiter: limits requests
server/src/index.js - HTTP and WebSocket entry → Room Durable Object: forwards WebSockets
server/src/index.js - HTTP and WebSocket entry → Matchmaking lobby: requests matchmaking
server/src/index.js - Matchmaking lobby → Lobby matching logic: uses matching functions
server/src/lobby.js - Matchmaking lobby → Room Durable Object: creates rooms
server/src/lobby.js - Room Durable Object → Room game authority: delegates room logic
server/src/room.js - Room game authority → Shared rules engine: checks game rules
server/src/room-logic.js - Room Durable Object → Matchmaking lobby: updates lobby
server/src/room.js - Online client → Room Durable Object: sends player actions