跳过主要内容
LUA
Skill免费GameSkill 出品 · 调优版

Defold Core

/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.

许可证
Apache-2.0
出品
GameSkill 出品
下载 ZIP

所属合集

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.

我们测过

在 Defold 1.14.0 (Bob 1.14.0 on OpenJDK 25, headless engine) 上通过 29/29 项检查(2026-11-03):能触发、有可运行示例、有截图和自检清单、单一职责、中英文文档齐全。触发检查是把提示词和 skill 描述做匹配,不是真实 agent 运行。

测试报告

这个 skill 做什么

什么时候触发

property, input focus and bindings, URLs and message passing, factories, collection factories and collection proxies, plus building and smoke-running with Bob.jar, or a Defold build error. …

GameSkill 测过的版本

GameSkill 调优版:skill 文件取自提交 19d93f97c9c1,按我们的 skill 流程加上可运行示例、测试报告、自检清单和中文指南。

下载测过的 ZIP(112 KB)路线图:引擎基础

协议:基于 gamedev-skills/awesome-gamedev-agent-skills(作者 gamedev-skills),协议 Apache-2.0。ZIP 保留协议文件(LICENSE, NOTICE),CHANGES.md 列出了 GameSkill 加的所有文件。

Defold Core

自检清单

  • game.project 里的路径带编译后缀 c(/main/main.collectionc) / game.project paths carry the compiled c suffix
  • 改完文件先跑 check_defold_project.py,直到退出码 0 / Run check_defold_project.py until it exits 0
  • require 用点号路径(modules.util),不用斜杠 / require uses dotted paths, not slashes
  • 每个被 proxy 加载的 collection 有唯一的 name / Every proxied collection has a unique name
  • 冒烟测试看日志里的完成标记和 ERROR 行,不只看退出码 / Judge a smoke run by its done marker and ERROR lines, not the exit code
  • 引擎运行总是加超时 / Always run the engine under a timeout

中文指南

这个 skill 做什么

用 Lua 搭建和调试 Defold 游戏的核心:game.project 设置、collection、game object 和组件、脚本生命周期和 self 状态、go.property、输入焦点和绑定、URL 和消息传递、factory、collection factory 和 collection proxy,以及用 Bob 构建并无头运行冒烟测试。附带一个只读的资源引用检查脚本,不需要安装 Defold。

什么时候用

  • 在 Defold 项目里新增或修改 game object、脚本、输入、消息、生成物体或关卡加载
  • Bob 报资源找不到、main collection 找不到、require 找不到模块
  • on_input 不触发、proxy 加载的关卡没有输入、proxy 一直不发 proxy_loaded

怎么装

下载本页 ZIP,把 defold-core/ 放进 agent 的 skills 文件夹:Claude Code 用 .claude/skills/,Codex、Gemini CLI、OpenCode 用 .agents/skills/,Cursor 用 .cursor/skills/,Copilot 用 .github/skills/,Windsurf 用 .windsurf/skills/。也可以直接对 agent 说:Install the skill from https://gameskill.dev/skills/defold-core/install.md

检查脚本只要 Python 3.10+;构建要 JDK 25 和与项目版本一致的 bob.jar(示例用 Defold 1.14.0)。

最小示例

gameskill/examples/lantern-drop/ 是原创的小项目「灯笼掉落」:loader 用 collection proxy 加载关卡,关卡里的 spawner 每 0.25 秒用 factory 生成一盏灯笼,灯笼带 go.property 下落,落地后发消息回 spawner 并删除自己。冒烟测试的 bootstrap 跑 3 秒后打印结果并退出。

我们怎么测的

总分 29/29,结果在 gameskill/test-report.json。用 OpenJDK 25 和 Bob 1.14.0(skill 写明的版本):skill 的检查脚本对干净项目报 0 错误,对埋了错的副本(game.project 少了后缀 c、factory 指向不存在的文件、路径大小写不对、require 不存在的模块)都退出 1 并指出文件;Bob 构建成功,埋错时报出 skill 说的那几行错误;无头包运行 3 秒,日志里有 6 盏灯笼全部落地、关卡通过 proxy 加载并卸载、没有 ERROR 行。另外验证了两条 skill 写的坑:proxy 加载的 collection 和主世界同名时报 socket 冲突、关卡不运行;Lua 运行时错误打印 ERROR:SCRIPT 和行号而引擎继续运行。无头引擎没有键盘,所以输入没有测到。

搭配

  • love2d-core:另一个 Lua 引擎
  • input-systems:按键重绑和手柄

安装

告诉你的 AI

Install the skill from https://gameskill.dev/skills/defold-core/install.md

GameSkill 测过的版本

测过的版本装到 .claude/skills/
mkdir -p .claude/skills
curl -fsSL https://gameskill.dev/dl/skills/defold-core.zip -o /tmp/gameskill-defold-core.zip
unzip -oq /tmp/gameskill-defold-core.zip -d .claude/skills
rm /tmp/gameskill-defold-core.zip

包含内容

  • Verified shapes for game.project, .collection, .go, .atlas and .input_binding files
  • Script lifecycle, input stack, URL and message-passing patterns in Lua
  • Factories, collection factories and collection proxies, with the socket-name pitfalls
  • scripts/check_defold_project.py: a read-only checker for broken resource paths and requires, no Defold install needed
  • A Bob build and headless smoke-test recipe that judges the run by its log

适合

  • Adding or fixing game objects, scripts, input, messages, spawning or level loading in a Defold project
  • Bob build errors such as a missing resource or a main collection that cannot be found

不适合

  • LÖVE or plain Lua projects (love2d-core)
  • GUI layout, sprites, tilemaps and physics depth

试试这条提示词

提示词
Add a spawner to my Defold game that drops a lantern every second through a factory, make the lanterns report back by message, and prove it with a Bob headless smoke run.

关于这个 Skill

Build and debug the core of a Defold game in Lua: game.project settings, collections, game objects and components, script lifecycle and self state, go.property, input focus and bindings, URLs and message passing, factories, collection factories and collection proxies, plus building and smoke-running with Bob.

From the defold-core SKILL.md in gamedev-skills/awesome-gamedev-agent-skills.

What's inside

  • Workflow: inspect, edit the right file type, check references, build with Bob, run it
  • Patterns: project paths, collections and game objects, script lifecycle, input stack, addressing and messages, factories, collection proxies
  • Pitfalls with the exact Bob and engine error lines
  • References: verified editor file shapes, and Bob build and headless smoke-test commands
  • scripts/check_defold_project.py: read-only reference checker

Notes

  • Bob 1.14.0 needs JDK 25; on Java 21 it fails at once with UnsupportedClassVersionError.
  • The headless engine draws nothing and has no input devices: check input and rendering in the editor or a desktop build.

环境要求

  • Python 3.10+ for the reference checker
  • JDK 25 and bob.jar (Defold 1.14.0 in the examples) to build and smoke-run

常见问题

基于 gamedev-skills/awesome-gamedev-agent-skills (作者 gamedev-skills,协议 Apache-2.0)。ZIP 里保留原作者的 LICENSE 和 NOTICE,ATTRIBUTION.md 和 CHANGES.md 写明来源提交和 GameSkill 加的内容。

搭配使用

作者标注的相关 Skills,或更适合相邻任务的 Skills。

Awesome Gamedev Agent Skills 中的更多 Skills

查看全部 45 个

相似 skills