Pygame Core
/pygame-core
Structure a pygame-ce game: the game loop, delta-time movement, blitting, keyboard and mouse input, and sprite groups with collision.
- 许可证
- Apache-2.0
- 出品
- GameSkill 出品
所属合集
Awesome Gamedev Agent Skills
77 portable SKILL.md skills across 12 engines (Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox, Defold, Ebitengine), with a router.
我们测过
在 pygame-ce 2.5.8 (SDL 2.32.10) 上通过 29/29 项检查(2026-10-30):能触发、有可运行示例、有截图和自检清单、单一职责、中英文文档齐全。触发检查是把提示词和 skill 描述做匹配,不是真实 agent 运行。
测试报告这个 skill 做什么
什么时候触发
Structure a pygame (pygame-ce) game in Python: the init/event/update/draw loop, delta-time movement, Surface/Rect blitting, keyboard/mouse input, and Sprite/Group management with collision.tick. Targets pygame-ce. …
GameSkill 测过的版本
GameSkill 调优版:skill 文件取自提交 19d93f97c9c1,按我们的 skill 流程加上可运行示例、测试报告、自检清单和中文指南。
协议:基于 gamedev-skills/awesome-gamedev-agent-skills(作者 gamedev-skills),协议 Apache-2.0。ZIP 保留协议文件(LICENSE, NOTICE),CHANGES.md 列出了 GameSkill 加的所有文件。

自检清单
- 移动乘以 dt(秒),不按帧算 / Movement scales by dt in seconds, not per frame
- 位置用浮点 Vector2 存,Rect 只用来画和碰撞 / Keep a float position; the Rect is for drawing and collision
- dt 有上限,卡顿后不会瞬移 / dt is capped so a stall does not teleport sprites
- set_mode 之后再 convert() / convert_alpha() / Call convert() or convert_alpha() after set_mode
- 移除精灵用 kill(),从所有 Group 中删掉 / Remove sprites with kill(), which leaves every group
中文指南
这个 skill 做什么
pygame(pygame-ce)游戏的基本结构:初始化、事件、更新、绘制的主循环,按时间步长移动(并限制卡顿时的超大步长),Surface 和 Rect 绘制,键盘鼠标输入,Sprite 和 Group 的管理和碰撞,以及标题、游戏、结束几个画面状态。
什么时候用
- 用 Python 和 pygame 写小游戏
- 修 pygame 里移动速度随帧率变化的问题
- 用 Sprite 和 Group 做碰撞
怎么装
下载本页的 ZIP,把 pygame-core/ 整个文件夹放进 agent 的 skills 文件夹:Claude Code 用 .claude/skills/,Codex、Gemini CLI、OpenCode 用 .agents/skills/,Cursor 用 .cursor/skills/,Copilot 用 .github/skills/,Windsurf 用 .windsurf/skills/,然后重启 agent。也可以直接对 agent 说:Install the skill from https://gameskill.dev/skills/pygame-core/install.md
最小示例
gameskill/examples/ 是一个 pygame-ce 小游戏:game.py 里提灯收集萤火虫(全部用形状画,没有素材文件),测试不需要真实窗口;tests/run_tests.py 是检查,tests/screenshot.py 渲染截图。
我们怎么测的
总分 29/29。在 Python 3.13 + pygame-ce 2.5.8(SDL 无窗口模式)下跑检查:30 帧和 120 帧一秒后移动距离一致;很小的步长不会被整数 Rect 吞掉(位置用浮点单独存);卡顿时的超大步长被限制;斜向移动不会更快;QUIT 和 ESC 结束循环;通过 event.post 投递的事件会被处理;鼠标点击开始游戏;碰撞后萤火虫被收集,kill() 会从所有 Group 移除;收完进入结束画面;同种子结果一致;用了 convert_alpha()。结果在 gameskill/test-report.json。
搭配
game-feel:手感和反馈audio-design:音效设计input-systems:输入映射
安装
告诉你的 AI
Install the skill from https://gameskill.dev/skills/pygame-core/install.md
GameSkill 测过的版本
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/pygame-core.zip -o /tmp/gameskill-pygame-core.zip
unzip -oq /tmp/gameskill-pygame-core.zip -d .claude/skills
rm /tmp/gameskill-pygame-core.zip包含内容
- Worked steps: Minimal game loop; Delta-time movement; Input: events vs polling; A Sprite subclass + a Group
- A pitfalls section with the mistakes to avoid
- Bundled 1 reference doc the agent reads when needed
- Written for pygame-ce
适合
- Building or debugging a pygame game
试试这条提示词
Set up a pygame-ce game loop with sprite groups and collision.关于这个 Skill
Structure a pygame (pygame-ce) game in Python: the init/event/update/draw loop, delta-time movement, Surface/Rect blitting, keyboard/mouse input, and Sprite/Group management with collision. Use when building or debugging a pygame game — when the user mentions pygame, pygame-ce, the game loop, blit, Surface, Rect, sprite groups, or clock.tick. Targets pygame-ce.
From the pygame-core SKILL.md in gamedev-skills/awesome-gamedev-agent-skills.
What's inside
- Minimal game loop (the skeleton)
- Delta-time movement (frame-rate independent)
- Input: events vs polling
- A Sprite subclass + a Group
- Collision detection
环境要求
- pygame-ce
常见问题
游戏打磨流程 Game Polish Workflow
让 AI 把游戏真正改好的可复用流程:10 步打磨循环、中英双语提示词、AI 做游戏常见问题排障清单,以及试玩和发布检查表。
- 10 步打磨循环,每步有完成标准
- 14 条中文 + 14 条英文提示词
基于 gamedev-skills/awesome-gamedev-agent-skills (作者 gamedev-skills,协议 Apache-2.0)。ZIP 里保留原作者的 LICENSE 和 NOTICE,ATTRIBUTION.md 和 CHANGES.md 写明来源提交和 GameSkill 加的内容。
搭配使用
作者标注的相关 Skills,或更适合相邻任务的 Skills。
LÖVE (Love2D) Core
Structure and debug a LÖVE (Love2D) game in Lua: the love.load/update/draw loop, delta-time movement, input, and screen states.
Bevy ECS
Structure a Bevy app around ECS: plugins, components and resources, systems with Query and Commands, system ordering and Time.
Game Input Systems
Game input architecture: action mapping, rebinding with conflict checks, keyboard, gamepad and touch, deadzones, buffering and coyote time.
Game Save Systems
Design save/load for game state — choosing what to serialize, file formats, save slots, atomic crash-safe writes, schema versioning and migration, and autosave.
Awesome Gamedev Agent Skills 中的更多 Skills
查看全部 42 个Behavior Trees & Utility AI
Build a behavior-tree runtime and a Utility AI system with response curves, plus hybrid agents where the behavior tree drives utility scoring.
Card Game
Build a card game: card data, deck/hand/discard zones, draw/shuffle/reshuffle, a turn structure, costs, and effect resolution.
Create Game Assets
Plan, generate, source, normalize, and validate cohesive visual game assets.
Defold Core
Build and debug the core of a Defold game in Lua: game.project, collections, game objects, script lifecycle, go.property, input focus, URLs and messages, factories and collection proxies, with a read-only reference checker and a Bob build plus headless smoke run.
相似 skills
Game Decompilation Skill For Claude
Seven Claude Code skills for byte-matching decompilation of retro games: rebuild readable C/C++ function by function, diagnose why a function won't match, and run parallel matcher workers. No license is published, so see the repository for use.
pyxel-skill
The official agent skill for building and verifying Pyxel retro games, by Pyxel's creator kitao. Bundles the pyxel-mcp server so the agent can run, screenshot and check its own game.
FunPlay Skill
14 MIT agent skills for game development with scripts and tests: sprite-sheet slicing, normal maps, audio conversion, game concept briefs, browser game slices, Unity MCP workflow and Cocos/WeChat minigame rules.
Ludra
A 2D game engine built for AI agents: games are JSON, every error comes with a machine-readable fix, and the agent plays and tests its own game headlessly. Ships a Claude Code plugin and skill.