ebitengine-game
它能做什么
该技能指导使用 Go 语言和 Ebitengine 库制作一款完整的 2D 游戏。适合希望获得规则清晰、具备输入、渲染、声音,并可在多个平台构建的可玩游戏的开发者。
适用场景
- ✓当你想用 Go 和 Ebitengine 库制作一款 2D 游戏时。
- ✓当现有的 Ebitengine 游戏在输入、渲染、文字或音频方面有 bug 时。
- ✓当你需要把 Ebitengine 游戏打包到桌面、浏览器或移动端时。
技能链接
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/ebitengine/ebitengine-game/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能帮我用 Go 和 Ebitengine 做一款小型 2D 游戏吗?玩家需要收集金币并躲避敌人。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先确定玩家的目标和主要决策,然后搭建包含输入、绘制、文字、声音和场景的可玩原型。它会测试并完善玩法,并以项目中锁定的 Ebitengine 版本为目标。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Ebitengine game
Deliver a game that is understandable, responsive and complete at the requested scope. One request can include several internal build/play/refine passes. A scaffold, successful build or attractive screenshot alone is not a finished game. For a focused fix, preserve the project's design and limit the workflow to the affected behavior.
The bundled starter targets Ebitengine v2.10.5 / Go 1.25+. This is a pinned baseline, not a claim about the latest release. Keep an existing project's versions unless an upgrade is needed and authorized. Check the pinned version's public API before using newer or experimental APIs. References contain patterns to adapt; only the bundled scripts and starter are executable deliverables. Their checks do not validate every reference snippet.
Delivery workflow
- Inspect and decide. Read repository instructions,
go.mod, theRunGameentrypoint and existing tests/assets. For new games, read Design and quality. Establish the player's goal, repeated decision, consequence, end/retry path, intended look, platform and supported input. Infer reasonable defaults; ask only for missing choices that materially change the product. Record a short brief and observable acceptance criteria in the project. - Build a representative playable slice. Make the central interaction and its feedback work with the intended controls and visual direction. Check the feel before expanding content. Keep scope small enough to finish; choose authored or procedural content based on the game, not the template. Calibrate content against actual player capabilities before multiplying levels. For an art set, establish shared perspective, scale, anchors and palette roles using Assets and animation.
- Complete and refine. Implement the promised start → play → outcome → retry/continue loop (or the appropriate persistent/sandbox loop). Refine hierarchy, animation, sound, difficulty and transitions in context. Read only the technical references needed for the selected systems. Fix discovered defects within this delivery rather than asking the user to iterate for you.
- Verify the product. Test rules and important transitions, exercise real input, inspect representative rendered states, and build/run requested targets. Include failure/retry and boundary cases. A scripted demo cannot establish control feel; a silent audio sink cannot establish sound quality. For automated multi-step interactions, pair observed images with actual state at the same tick; see Playtest diagnostics.
- Hand off. Supply launch/build instructions, actual artifact paths and asset licences. State what was run and observed, what remains unverified, and any material limitations. Publishing, purchases and external uploads are separate actions within the user's requested scope.
Starting a project
Resolve commands relative to this skill's directory, not the game's working
directory. Set skill_dir to the actual installed location, then for example:
python3 "$skill_dir/scripts/new_game.py" --out mygame \
--module example.com/mygame --title "My Game"
cd mygame
go mod tidy
go test ./world/...
The starter demonstrates scenes, action input, text, sound, a camera, pause and
scripted capture using a small platformer. It is an integration example,
not a genre or architecture requirement. Replace its rules, controls, level,
presentation and scene flow to fit the brief; a puzzle or card game should not
inherit gravity, jumping, camera scrolling or a platformer HUD. Existing projects
rarely need a scaffold. --ci adds a workflow and tools; inspect its triggers,
targets and release behavior before enabling it.
Loop and resource contracts
| Method | Responsibility | Important distinction |
|---|---|---|
Update() error |
Sample actions, advance simulation, apply scene changes and trigger event audio | Default target is 60 fixed ticks/s. Catch-up updates, focus pauses and slow machines affect actual scheduling. |
Draw(screen *ebiten.Image) |
Render the state produced by updates | Calls are not one-to-one with ticks. Do not advance gameplay, consume input edges or start sounds here. Renderer-owned caches are separate from simulation state. |
Layout(outsideW, outsideH int) (int, int) |
Choose logical dim |
常见问题
它以哪个 Ebitengine 版本为目标?
内置的入门模板以 Ebitengine v2.10.5 和 Go 1.25 或更高版本为目标,已有项目则保留其自身的版本。
只有一个脚手架就足以算完成游戏吗?
不够。该技能指出,仅有脚手架、构建成功或一张截图,都不算完成的游戏。
它能修复我游戏中的小问题吗?
可以。对于针对性的修复,它会将工作限制在受影响的行为上,并保持设计不变。
详情
作者的原始描述
Create, improve, debug and package playable 2D games in Go with Ebitengine (github.com/hajimehoshi/ebiten/v2). Use for Ebitengine game requests: game design translated into a complete loop, input, rendering, text, audio, scenes, gameplay tests and desktop, browser or mobile builds. Also use when fixing these systems in an existing Ebitengine game. Do not apply to unrelated Go software or engine-internal patches merely because they depend on Ebitengine.
热度
- GitHub 星标
- 6.6k
- 排名
- #13806
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/28
评论
- …