defold-core
Fungsinya
Skill ini menjelaskan cara menyusun dan memperbaiki game Defold yang ditulis dalam Lua, termasuk file proyek, skrip, dan pesannya. Skill ini ditujukan untuk pengembang yang memakai engine game Defold.
Kapan dipakai
- ✓Saat proyek Defold memiliki file game.project, collection, game object, atau file skrip yang perlu Anda ubah.
- ✓Saat Anda memerlukan objek yang mengirim pesan, muncul saat berjalan, atau memuat level baru di Defold.
- ✓Saat build Defold melaporkan resource yang hilang dan Anda perlu mencari penyebabnya.
Link skill
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/other-engines/defold-core/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Di game Defold saya, musuh perlu muncul di lokasi acak setiap beberapa detik. Bisakah Anda menyiapkannya?”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Skill memandu agent untuk membaca pengaturan proyek, mengedit jenis file yang tepat untuk setiap bagian, mengikuti penamaan yang ada, dan menjalankan pemeriksaan build untuk memastikan game berfungsi.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apa itu collection di Defold?
Collection adalah file yang menempatkan game object dan collection lain dalam sebuah level.
Apa itu Bob?
Bob adalah alat build Defold yang dipakai skill untuk membangun game dan menjalankan pemeriksaan cepat.
Apakah ini mencakup tata letak GUI?
Tidak secara mendalam. GUI, sprite, dan tile map hanya ditunjuk, tidak dicakup sepenuhnya.
Detail
Deskripsi asli dari pembuat
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.
Popularitas
- Bintang GitHub
- 6.6k
- Peringkat
- #13833
- Lisensi
- Apache-2.0
- Diperbarui
- 28/10/2026
Komentar
- …
Skill lain dari repositori ini
router
6.6kMembantu agent Anda memilih skill pengembangan game yang tepat untuk setiap permintaan dengan mendeteksi engine Anda dan jenis tugas yang Anda perlukan.
ai-behavior-trees-utility-ai
6.6kMembantu agent Anda membangun behavior tree dan sistem utility AI untuk musuh dan karakter game yang memilih aksi berdasarkan prioritas dan skor.
audio-design
6.6kMengajari agent Anda cara mixing audio game: bus, volume dalam desibel, ducking di bawah dialog, musik adaptif, dan variasi efek suara.
camera-systems
6.6kMembantu agent Anda membangun kamera game yang mengikuti dengan halus, tetap berada di dalam level, dan dapat mengorbit atau melihat sekeliling dalam 3D.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.