Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
[![Github-sponsors](https://img.shields.io/badge/sponsor-30363D?style=for-the-badge&logo=GitHub-Sponsors&logoColor=#EA4AAA)](https://github.com/sponsors/insality) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/insality) [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://www.buymeacoffee.com/insality)


# Disclaimer

The library in development stage. May be not fully tested and README may be not full. If you have any questions, please, create an issue.


# Decore

**Decore** - a Defold library for managing ECS game entities and components in a data-driven way. The ECS is based on [tiny ECS](https://github.com/bakpakin/tiny-ecs) library.
Expand All @@ -26,7 +21,7 @@ The library in development stage. May be not fully tested and README may be not

Add in your `game.project` dependencies:
```
https://github.com/Insality/decore/archive/refs/tags/2.zip
https://github.com/Insality/decore/archive/refs/tags/3.zip
```

### Basic Usage
Expand All @@ -52,18 +47,24 @@ function update(self, dt)
self.world:update(dt)
end


function on_input(self, action_id, action)
-- Systems can be accessed via world, if registered
return self.world.input:on_input(action_id, action)
end


function final(self)
self.world:clearEntities()
self.world:clearSystems()
end
```

## Examples
Look at next examples to get more information about how to use the library:
- [System examples](https://github.com/Insality/asset-store/tree/main/system/Insality) - System examples
- [Entity example](https://github.com/Insality/cosmic-dash-jam-2025/blob/main/entity/player/player_entity.lua) - Entity example
- [Shooting Circles](https://github.com/Insality/shooting_circles) - Game Example
- [Cosmic Dash](https://github.com/Insality/cosmic-dash-jam-2025) - Game Example


## Quick API Reference

Expand Down Expand Up @@ -98,11 +99,14 @@ decore.create_component(component_id, [component_pack_id])
decore.apply_component(entity, component_id, [component_data])
decore.apply_components(entity, [components])

-- Find entities
decore.find_entities(world, component_id, [component_value])

-- Debug functions
decore.print_loaded_packs_debug_info()
decore.print_loaded_systems_debug_info(world)

-- Logging
decore.set_logger([logger_instance])
decore.get_logger([name], [level])
```
Expand All @@ -115,6 +119,23 @@ This project is licensed under the MIT License - see the LICENSE file for detail

If you have any issues, questions or suggestions please [create an issue](https://github.com/Insality/decore/issues).

## Changelog

<details>

### **V1**
- Initial release

### **V2**
- Reworked API and internal structure
- Updated documentation

### **V3**
- Updated event bus system for better performance
- Update documentation

</details>

## ❤️ Support project ❤️

Your donation helps me stay engaged in creating valuable projects for **Defold**. If you appreciate what I'm doing, please consider supporting me!
Expand Down
35 changes: 35 additions & 0 deletions USE_CASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use Cases

This section illustrates practical examples of how to use the Decore module in your Defold game development projects.

## Global world module

Often for convenience, we can create a Lua module file which will be used as a global world module.

```lua
-- /game/world.lua

--- Use this module to get the latest created world instance
---@class world
local M = {}
local METATABLE = { __index = nil }

---@param world world
function M.set_world(world)
METATABLE.__index = world
end

return setmetatable(M, METATABLE)
```

```lua
-- Game script
local decore = require("decore.decore")
local world = require("game.world")

function init(self)
self.world = decore.new_world(...)
-- Set a world after creation to have access to it from any script later
world.set_world(self.world)
end
```
19 changes: 0 additions & 19 deletions assets/atlases/game.atlas

This file was deleted.

10 changes: 0 additions & 10 deletions assets/fonts/text.font

This file was deleted.

Binary file removed assets/fonts/troika.otf
Binary file not shown.
Binary file removed assets/images/empty.png
Binary file not shown.
Binary file removed assets/images/pixel.png
Binary file not shown.
Binary file removed assets/images/ui_circle_16.png
Binary file not shown.
Binary file removed assets/images/ui_circle_32.png
Binary file not shown.
Binary file removed assets/images/ui_circle_64.png
Binary file not shown.
Binary file removed assets/images/ui_circle_8.png
Binary file not shown.
19 changes: 0 additions & 19 deletions core/atlas/core.atlas

This file was deleted.

10 changes: 0 additions & 10 deletions core/fonts/text.font

This file was deleted.

Binary file removed core/fonts/troika.otf
Binary file not shown.
Binary file removed core/images/empty.png
Binary file not shown.
Binary file removed core/images/pixel.png
Binary file not shown.
Binary file removed core/images/ui_circle_16.png
Binary file not shown.
Binary file removed core/images/ui_circle_32.png
Binary file not shown.
Binary file removed core/images/ui_circle_64.png
Binary file not shown.
Binary file removed core/images/ui_circle_8.png
Binary file not shown.
4 changes: 0 additions & 4 deletions core/particles/confetti/fx_confetti.atlas

This file was deleted.

Binary file removed core/particles/confetti/fx_confetti.png
Binary file not shown.
Loading