defold-core
Что он делает
Этот скилл объясняет, как структурировать и исправлять игру на Defold, написанную на Lua, включая файлы проекта, скрипты и сообщения. Он нужен разработчикам, которые используют игровой движок Defold.
Когда использовать
- ✓Когда в проекте Defold нужно изменить файл game.project, коллекции, игровые объекты или скрипты.
- ✓Когда нужно, чтобы объекты отправляли сообщения, создавались во время игры или загружали новый уровень в Defold.
- ✓Когда сборка Defold сообщает об отсутствующем ресурсе и нужно найти причину.
Ссылка на скилл
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/defold-core/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“В моей игре на Defold враги должны появляться в случайных местах каждые несколько секунд. Можешь настроить это?”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Скилл ведет агента к чтению настроек проекта, редактированию нужного типа файла для каждой части, соблюдению существующего именования и запуску проверки сборки, чтобы убедиться, что игра работает.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Defold Core
Structure, wire and verify a Defold game: editor resource files, the Lua script lifecycle, addressing and messages, runtime spawning and world loading, and a Bob build-and-run check. Examples target Defold 1.14.0; they were built with Bob 1.14.0 and run on the 1.14.0 headless engine. An existing project keeps its Defold version (see Version).
When to use
- Use when adding or fixing game objects, collections, scripts, input, messages, spawning or
level loading in a Defold project (
game.projectin the root,.collection,.go,.script,.gui_scriptfiles), or when Bob reports a missing resource.
When not to use: plain Lua or LÖVE projects (love2d-core); GUI layout, sprites,
tilemaps and physics depth beyond the pointers in the references; engine-agnostic design
handled by the related skills below.
Workflow
- Inspect first. Read
game.project([bootstrap] main_collection,[input] game_binding,[project] dependencies), the main collection, and the scripts near the request. Follow the project's folder layout, id naming and message names; do not reorganize. Note which Defold/Bob version CI or the team uses. - Edit the right file type. Game objects (
.go) hold components; collections (.collection) place game objects and other collections; logic goes in.script(game objects),.gui_script(GUI) or shared.luamodules. Editor files are protobuf text: keep their structure, and copy shapes fromreferences/file-formats.mdinstead of guessing fields. - Check references. Run
python scripts/check_defold_project.py <project-dir>(path relative to this skill folder; Python 3.10+, no Defold install needed). Fix everyERROR(missing or wrong-case/paths, agame.projectpath without the compiledcsuffix, arequirewhose file does not exist). Warnings cover files nothing uses yet, unfetched library dependencies and runtime-loaded files. Re-run until it exits 0. - Build with Bob.
java -jar bob.jar --root . --variant headless --archive resolve buildneeds JDK 25 and abob.jarmatching the project's Defold version. Exit 1 plus anERROR:line means a broken reference or a Lua syntax error (with file and line);references/file-formats.mdshows how to trace an error that names a generated file. - Run it. A build does not prove the game works. Run a headless bundle under a timeout
(
references/build-and-run.md) and read the log:ERROR:SCRIPT:lines are Lua runtime errors,ERROR:GAMEOBJECT:lines bad addresses or socket clashes. Require a line your test prints when it finishes; the exit code alone proves nothing. The headless engine has no keyboard or mouse, so check input changes in the editor or a desktop build, and say what you could not verify.
Patterns
Project and resource references
game.project is an INI file in the project root. Resource paths everywhere are
root-absolute (/main/player.go). In game.project they name the compiled file, so the
source path gets a trailing c:
[bootstrap]
main_collection = /main/main.collectionc
[input]
game_binding = /input/game.input_bindingc
Bob builds only what is reachable from game.project; /builtins/... ships with the engine.
Collections, game objects, components
A collection places instances and can override script properties per instance; a game object
lists file components and embedded components (escaped data: strings). Full verified
files are in references/file-formats.md.
# main.collection (excerpt): place player.go and override its script's speed
instances {
id: "player"
prototype: "/main/player.go"
component_properties {
id: "player"
properties { id: "speed" value: "250.0" type: PROPERTY_TYPE_NUMBER }
}
}
Script lifecycle, self and properties
go.property("speed", 200) -- top level only, literal default; editable per instance
local LEFT = hash("left") -- hash ids once, not every frame
local RIGHT = hash("right")
local FIRE = hash("fire")
function init(self)
msg.post(".", "acquire_input_focus") -- no focus, no on_input calls
self.held = {} -- per-instance state lives on self
end
function update(self, dt)
local dir = (self.held[RIGHT] and 1 or 0) - (self.held[LEFT] and 1 or 0)
if dir ~= 0 then
local pos = go.get_position()
pos.x = pos.x + dir * sel
Частые вопросы
Что такое коллекция в Defold?
Коллекция — это файл, который размещает игровые объекты и другие коллекции на уровне.
Что такое Bob?
Bob — это инструмент сборки Defold, который скилл использует для сборки игры и быстрой проверки.
Покрывает ли он разметку GUI?
Не подробно. Разметку GUI, спрайты и тайловые карты только упоминают, но не раскрывают полностью.
Подробности
Оригинальное описание автора
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. Use when a project has game.project or .collection, .go, .script, .gui_script or .input_binding files, or the request mentions Defold, msg.post, on_message, on_input, acquire_input_focus, factory.create, collection proxy, bob.jar, or a Defold build error.
Популярность
- Звёзды на GitHub
- 6.6k
- Место в рейтинге
- #13833
- Лицензия
- Apache-2.0
- Обновлён
- 28.10.2026
Комментарии
- …
Другие скиллы из этого репозитория
router
6.6kПомогает агенту выбрать нужный скилл для игровой разработки, определив движок и тип задачи.
ai-behavior-trees-utility-ai
6.6kПомогает агенту построить дерево поведения и систему утилитарного ИИ для врагов и персонажей игры, которые выбирают действия по приоритету и оценке.
audio-design
6.6kУчит агента сведению звука в играх: шины, громкость в децибелах, приглушение под диалоги, адаптивная музыка и вариации звуковых эффектов.
camera-systems
6.6kПомогает агенту создавать игровые камеры, которые плавно следуют за объектом, остаются в пределах уровня и вращаются или осматриваются в 3D.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.