Skip to content

Commit d437b63

Browse files
authored
Merge pull request #2 from Insality/develop
Develop
2 parents 9341338 + 4728c55 commit d437b63

85 files changed

Lines changed: 1072 additions & 4413 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci_workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
- uses: actions/setup-java@v3
1515
with:
1616
distribution: 'zulu'
17-
java-version: '17'
17+
java-version: '21'
1818

1919
- name: Build && Run
2020
run: |
21-
deployer_url="https://raw.githubusercontent.com/Insality/defold-deployer/4/deployer.sh"
21+
deployer_url="https://raw.githubusercontent.com/Insality/defold-deployer/1/deployer.sh"
2222
curl -s ${deployer_url} | bash -s lbd --headless --settings ./test/test.ini
2323
2424
- name: Upload coverage reports to Codecov
2525
uses: codecov/codecov-action@v4.0.1
2626
with:
2727
token: ${{ secrets.CODECOV_TOKEN }}
28-
slug: insality/decore
28+
slug: insality/decore

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ deployer_build_stats.csv
1010
bob*.jar
1111
manifest.*.der
1212
/.editor_settings
13-
lls_export.json
13+
lls_export.json
14+
deployer_version_settings.ini

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
"~/Library/Application Support/Code/User/globalStorage/astronachos.defold",
5858
"~/Library/Application Support/Code/User/workspaceStorage/d5f9bf017bc262ec86a14da3c3f3032d/astronachos.defold",
5959
"~/Library/Application Support/Cursor/User/globalStorage/astronachos.defold",
60-
"~/Library/Application Support/Cursor/User/workspaceStorage/d5f9bf017bc262ec86a14da3c3f3032d/astronachos.defold"
60+
"~/Library/Application Support/Cursor/User/workspaceStorage/d5f9bf017bc262ec86a14da3c3f3032d/astronachos.defold",
61+
"~/Library/Application Support/Cursor/User/workspaceStorage/98e90effb1b63af519b5132f34e59df1/astronachos.defold"
6162
],
6263
"Lua.workspace.ignorePatterns": [
6364
"**/*.md"

README.md

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,66 @@ The library in development stage. May be not fully tested and README may be not
1414

1515
# Decore
1616

17-
**Decore** - a Defold library for managing ECS game entities and components in a data-driven way. It provides functionality for creating and managing game entities with their components.
17+
**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.
1818

1919
## Features
2020

21-
* **Entity Management**: Create and manage game entities
21+
* **Entity Management**: Register, create and manage game entities
2222
* **Component Management**: Add, remove and update entity components
2323
* **Easy Integration**: Simple setup and integration with Defold projects
2424

2525
## Installation
2626

2727
Add in your `game.project` dependencies:
2828
```
29-
https://github.com/Insality/decore/archive/refs/tags/1.zip
29+
https://github.com/Insality/decore/archive/refs/tags/2.zip
3030
```
3131

32+
### Basic Usage
33+
34+
```lua
35+
local decore = require("decore.decore")
36+
37+
function init(self)
38+
local world = decore.new_world(
39+
require("system.input.system_input").create(),
40+
require("system.transform.system_transform").create(),
41+
require("system.game_object.system_game_object").create(),
42+
)
43+
44+
decore.register_entities("game", {
45+
["player"] = require("entity.player.player_entity")
46+
})
47+
48+
world:addEntity(decore.create_prefab("player"))
49+
end
50+
51+
function update(self, dt)
52+
self.world:update(dt)
53+
end
54+
55+
56+
function on_input(self, action_id, action)
57+
return self.world.input:on_input(action_id, action)
58+
end
59+
60+
61+
function final(self)
62+
self.world:clearEntities()
63+
self.world:clearSystems()
64+
end
65+
```
66+
67+
3268
## Quick API Reference
3369

3470
```lua
3571
local decore = require("decore.decore")
3672

37-
decore.world(...)
73+
decore.new_world(...)
3874
decore.on_input(world, action_id, action)
3975
decore.on_message(world, message_id, [message], [sender])
40-
decore.final([world])
76+
decore.final(world)
4177

4278
decore.system(system_module, system_id, [require_all_filters])
4379
decore.processing_system(system_module, system_id, [require_all_filters])
@@ -48,26 +84,30 @@ decore.register_entity(entity_id, entity_data, [pack_id])
4884
decore.register_entities(pack_id, entities)
4985
decore.unregister_entities(pack_id)
5086

87+
decore.create([components])
88+
decore.create_prefab([prefab_id], [pack_id], [components])
89+
5190
decore.register_component(component_id, [component_data], [pack_id])
52-
decore.register_components(components_data_or_path)
91+
decore.register_components(components_data)
5392
decore.unregister_components(pack_id)
5493

55-
decore.create_entity([prefab_id], [pack_id], [data])
5694
decore.create_component(component_id, [component_pack_id])
5795
decore.apply_component(entity, component_id, [component_data])
5896
decore.apply_components(entity, [components])
5997

6098
decore.get_entity_by_id(world, id)
61-
decore.find_entities_by_component_value(world, component_id, [component_value])
62-
decore.is_alive(world_or_system, entity)
99+
decore.find_entities(world, component_id, [component_value])
63100

64101
decore.print_loaded_packs_debug_info()
65102
decore.print_loaded_systems_debug_info(world)
66-
decore.parse_command(command)
103+
104+
decore.parse_command(command_string)
67105
decore.call_command(world, [command])
68106

69107
decore.set_logger([logger_instance])
70-
decore.get_logger(name, [level])
108+
decore.get_logger([name], [level])
109+
110+
decore.render_properties_panel(world, druid, properties_panel)
71111
```
72112

73113
## License

USE_CASES.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)