一键导入
game-engine
Game state machine, lobby system, question flow, scoring, and real-time game coordination
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Game state machine, lobby system, question flow, scoring, and real-time game coordination
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
File upload, parsing (PDF, PPTX, DOCX, ODT, HTML, MD), and Convex storage for lesson materials
Convex database schema, queries, mutations, actions, and real-time subscriptions for LessonPlay
Gemini API integration for generating pedagogically-grounded game questions from lesson content
shadcn/ui patterns, game UI components, responsive layouts for classroom use
| name | game-engine |
| description | Game state machine, lobby system, question flow, scoring, and real-time game coordination |
Manages the game lifecycle from lobby to completion — state transitions, question progression, answer tracking, scoring, iframe communication, and real-time coordination between host and players.
lobby → playing → question ←→ results → complete
↑ |
└──────────────┘ (next question)
| From | To | Trigger |
|---|---|---|
| lobby | question | Host clicks "Start Game" |
| question | results | Host clicks "Show Results" OR timer expires |
| results | question | Host clicks "Next Question" (if questions remain) |
| results | complete | Host clicks "Next Question" on last question |
Points = correctness_points + speed_bonus
correctness_points = correct ? 1000 : 0
speed_bonus = correct ? max(0, 500 * (1 - timeMs / timerDuration)) : 0
Max points per question: 1500 (correct + fastest possible)
TIME_UP to iframe via MessageChannelParent and iframe communicate via a private MessageChannel:
MessageChannel, transfers one port to iframe via initial postMessageallow-scripts + allow-same-origin in sandboxconvex/games.ts — Game state mutationsconvex/answers.ts — Answer submission and scoringconvex/players.ts — Player management and scorescomponents/GameIframe.tsx — Sandboxed iframe wrapper with MessageChannel