一键导入
pydartsnut-game-io
Dartsnut game main.py guidance for pygame loops, dart hits, buttons, and framebuffer updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Dartsnut game main.py guidance for pygame loops, dart hits, buttons, and framebuffer updates.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Dartsnut asset manifest, loader-helper, placeholder, and apply-mode workflow for art-bearing entities.
Root conf.json schema, defaults, size rules, preview handling, and reload requirements for Dartsnut projects.
Dartsnut workspace scaffold rules, just-in-time skill loading, file constraints, and emulator verification workflow.
Dartsnut display and framebuffer mapping rules for panels, physical screens, layout, clipping, and fonts.
Legacy Dartsnut runtime index that routes to the granular pydartsnut, conf, display, and asset skills.
Pixel-perfect compact UI guidance for console-style Dartsnut games and widgets.
| name | pydartsnut-game-io |
| description | Dartsnut game main.py guidance for pygame loops, dart hits, buttons, and framebuffer updates. |
| license | MIT |
Load when main.py needs dart hits, buttons, or a full game loop.
Requires pydartsnut-core and conf-contract already applied.
pygame for drawing and local quit events.Dartsnut for machine input and update_frame_buffer.pygame.display.flip() → push framebuffer.| Need | API |
|---|---|
| New dart hits | engine.get_dart_hits() → (dart_index, x, y) per hit, consumed once |
| Presence / timing | engine.get_active_darts() only when required |
| Button presses | engine.get_button_events() edge-detected |
Forbidden: get_buttons(), get_darts(), or a separate input_handler.py that bypasses these APIs.
dart_index is usually 0–11. Map dart_index % 4 → blue, red, green, yellow (0→blue, 1→red, 2→green, 3→yellow). RGB helpers: load game-dart-colors when coloring UI from hits.
handle_events / poll hits → update → draw → flip → update_frame_buffer.
Use antialias=False on font.render(...) for device text.