{"skill":{"slug":"defold","displayName":"Defold Game Engine","summary":"Develop games using Defold engine with Lua scripting, including components, GUI, physics, animation, input handling, dynamic objects, and save/load systems.","description":"---\nname: defold\ndescription: Defold game engine development. Triggers: \"Defold\", \"Defold project\", \"Defold engine\", \"Lua game\", \"mobile game development\", \"build a game\", \"game engine\", \"create game\", \"sprite animation\", \"physics collision\", \"game save system\". Covers: GO/components/message passing, GUI/Druid, physics/collision/forces, animation/flipbook/Spine, input/binding, Factory/CollectionProxy, DefSave, game patterns. Use for any Defold-based game project.\n---\n\n# Defold Game Engine\n\n## Quick Start\n\n### Install Dependencies\n```\nhttps://github.com/Insality/druid/archive/refs/tags/1.2.2.zip\nhttps://github.com/subsoap/defsave/archive/refs/tags/v1.2.6.zip\nhttps://github.com/insality/defold-monarch/archive/1.0.zip\n```\n\n### Project Structure\n```\nmain.collection\n├── game_manager.go\n├── player.go\n└── ui.go\n```\n\n## Core Patterns\n\n### Message Passing\n```lua\nmsg.post(\"target#script\", \"event\", { data = value })\n\nfunction on_message(self, message_id, message, sender)\n    if message_id == hash(\"event\") then handle(message) end\nend\n```\n\n### Dynamic Objects\n```lua\nlocal id = factory.create(\"#factory\", pos, nil, { prop = value })\nlocal ids = collectionfactory.create(\"#collection_factory\")\nmsg.post(\"#proxy\", \"load\")  -- Wait for proxy_loaded, then init+enable\n```\n\n### GUI (Druid)\n```lua\nself.druid = druid.new(self)\nself.btn = self.druid:new_button(\"node\", callback)\nself.text = self.druid:new_text(\"node\", \"text\")\n```\n\n### Physics\n```lua\nphysics.apply_force(\"#collision\", force)\nphysics.set_velocity(\"#collision\", velocity)\n\nfunction on_message(self, message_id, message, sender)\n    if message_id == hash(\"collision_response\") then\n        handle_collision(message.other_id, message.normal)\n    end\nend\n```\n\n### Animation\n```lua\nsprite.play_flipbook(\"#sprite\", \"idle\", callback)\ngo.animate(\".\", \"position.y\", go.PLAYBACK_ONCE_FORWARD, 100, go.EASING_OUTQUAD, 1.0)\n```\n\n### Input\n```lua\nmsg.post(\".\", \"acquire_input_focus\")\n\nfunction on_input(self, action_id, action)\n    if action_id == hash(\"jump\") and action.pressed then jump() end\nend\n```\n\n### Save/Load\n```lua\ndefsave.load(\"game\")\ndefsave.set(\"game\", \"coins\", 100)\nlocal coins = defsave.get(\"game\", \"coins\")\n```\n\n## References\n\n- **Core Concepts**: [core-concepts.md](references/core-concepts.md) - GO, components, addressing, lifecycle\n- **GUI System**: [gui-system.md](references/gui-system.md) - Nodes, layouts, Druid\n- **Dynamic Objects**: [dynamic-objects.md](references/dynamic-objects.md) - Factory, Collection Factory, Proxy\n- **Data Storage**: [data-storage.md](references/data-storage.md) - sys.save, DefSave, io.*\n- **Physics**: [physics-system.md](references/physics-system.md) - Collision, forces, raycast\n- **Animation**: [animation-system.md](references/animation-system.md) - Flipbook, Spine, go.animate\n- **Input**: [input-system.md](references/input-system.md) - Binding, focus, on_input\n- **Game Patterns**: [business-patterns.md](references/business-patterns.md) - Customers, shops, upgrades\n\n## Performance\n\n- Atlas all sprites\n- Message-driven logic, avoid polling\n- Reuse vectors/tables\n- Engine handles object pooling","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":305,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1778404838717,"updatedAt":1778492892498},"latestVersion":{"version":"1.0.0","createdAt":1778404838717,"changelog":"Initial release. Defold game engine skill covering core concepts, GUI, physics, animation, input, dynamic objects, data storage, and game patterns.","license":"MIT-0"},"metadata":null,"owner":{"handle":"andyrenxu7255","userId":"s1721fhgyy0yf38f9gfpbjxrn984fcz0","displayName":"Andy Ren","image":"https://avatars.githubusercontent.com/u/230916456?v=4"},"moderation":null}