본문으로 건너뛰기
Skillpedia
일반 코딩6.6k · #13833

defold-core

하는 일

이 스킬은 프로젝트 파일, 스크립트, 메시지를 포함해 Lua로 작성된 Defold 게임을 구성하고 고치는 방법을 설명합니다. Defold 게임 엔진을 사용하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓game.project 파일, 컬렉션, 게임 오브젝트 또는 스크립트 파일이 있는 Defold 프로젝트를 수정해야 할 때.
  • ✓Defold에서 객체가 메시지를 보내거나, 실행 중에 생성되거나, 새 레벨을 불러와야 할 때.
  • ✓Defold 빌드가 리소스를 찾을 수 없다고 보고해서 원인을 찾아야 할 때.

스킬 링크

https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/defold-core/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/defold-core/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 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.project in the root, .collection, .go, .script, .gui_script files), 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

  1. 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.
  2. 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 .lua modules. Editor files are protobuf text: keep their structure, and copy shapes from references/file-formats.md instead of guessing fields.
  3. 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 every ERROR (missing or wrong-case /paths, a game.project path without the compiled c suffix, a require whose file does not exist). Warnings cover files nothing uses yet, unfetched library dependencies and runtime-loaded files. Re-run until it exits 0.
  4. Build with Bob. java -jar bob.jar --root . --variant headless --archive resolve build needs JDK 25 and a bob.jar matching the project's Defold version. Exit 1 plus an ERROR: line means a broken reference or a Lua syntax error (with file and line); references/file-formats.md shows how to trace an error that names a generated file.
  5. 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.

repo: gamedev-skills/awesome-gamedev-agent-skills

인기도

GitHub 스타
6.6k
순위
#13833
라이선스
Apache-2.0
업데이트
2026. 10. 28.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬