5 Commits

Author SHA1 Message Date
bakpakin
5978ace463 Update to version 1.1-3 2015-06-14 10:22:03 -04:00
bakpakin
a504bd6336 Add removeSystem to World metatable. 2015-06-14 10:17:18 -04:00
bakpakin
69ae37586e Fix scm rockspec. 2015-06-07 20:05:56 -04:00
bakpakin
44fb94c457 Add scm rockspec. Fix README. 2015-06-07 18:47:50 -04:00
bakpakin
9230dad1e1 Update README.md to direct users to demo. 2015-05-17 08:26:04 +08:00
4 changed files with 53 additions and 10 deletions
+4 -9
View File
@@ -8,6 +8,8 @@ Component Systems, here is some
Tiny-ecs also works well with objected oriented programming in lua because Tiny-ecs also works well with objected oriented programming in lua because
Systems and Entities do not use metatables. This means you can subclass your Systems and Entities do not use metatables. This means you can subclass your
Systems and Entities, and use existing lua class frameworks with tiny-ecs, no problem. Systems and Entities, and use existing lua class frameworks with tiny-ecs, no problem.
For an example on how to use tiny-ecs with object-oriented lua, take a look at the
demo branch, specifically the systems and entities sub-directories.
## Overview ## ## Overview ##
Tiny-ecs has four important types: Worlds, Filters, Systems, and Entities. Tiny-ecs has four important types: Worlds, Filters, Systems, and Entities.
@@ -29,7 +31,7 @@ Systems in tiny-ecs describe how to update Entities. Systems select certain Enti
using a Filter, and then only update those select Entities. Some Systems don't using a Filter, and then only update those select Entities. Some Systems don't
update Entities, and instead just act as function callbacks every update. Tiny-ecs update Entities, and instead just act as function callbacks every update. Tiny-ecs
provides functions for creating Systems easily, as well as creating Systems that provides functions for creating Systems easily, as well as creating Systems that
can be used in an object orientented fashion. can be used in an object oriented fashion.
### Filters ### ### Filters ###
Filters are used to select Entities. Filters can be any lua function, but Filters are used to select Entities. Filters can be any lua function, but
@@ -64,7 +66,7 @@ end
## Use It ## ## Use It ##
Copy paste tiny.lua into your source folder. For stability and consistent API, Copy paste tiny.lua into your source folder. For stability and consistent API,
please use a tagged release or use luarocks. Tagged releases will have a version please use a tagged release or use luarocks. Tagged releases will have a version
number in `tiny._VERSION`, while other commits will just have the string 'dev'. number in `tiny._VERSION`, while other commits will just have the string 'scm'.
## Luarocks ## ## Luarocks ##
Tiny-ecs is also on [Luarocks](https://luarocks.org/) and can be installed with Tiny-ecs is also on [Luarocks](https://luarocks.org/) and can be installed with
@@ -83,10 +85,3 @@ Tiny-ecs uses [busted](http://olivinelabs.com/busted/) for testing. Install and
See API [here](http://bakpakin.github.io/tiny-ecs/doc/). See API [here](http://bakpakin.github.io/tiny-ecs/doc/).
For the most up-to-date documentation, read the source code, or generate the HTML For the most up-to-date documentation, read the source code, or generate the HTML
locally with [LDoc](http://stevedonovan.github.io/ldoc/). locally with [LDoc](http://stevedonovan.github.io/ldoc/).
## TODO ##
* More testing
* Performance testing / optimization
* Add more System types
* Improve Documentation
+24
View File
@@ -0,0 +1,24 @@
package = "tiny-ecs"
version = "1.1-3"
source = {
url = "git://github.com/bakpakin/tiny-ecs",
tag = "1.1-3"
}
description = {
summary = "Entity Component System for Lua.",
detailed = [[
Pure Lua implementation of an easy to use, compact, fast, and flexible
Entity Component System. Works well with Object Orientation.
]],
homepage = "https://github.com/bakpakin/tiny-ecs",
license = "MIT"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
tiny = "tiny.lua"
}
}
+23
View File
@@ -0,0 +1,23 @@
package = "tiny-ecs"
version = "scm-0"
source = {
url = "git://github.com/bakpakin/tiny-ecs",
}
description = {
summary = "Entity Component System for Lua.",
detailed = [[
Pure Lua implementation of an easy to use, compact, fast, and flexible
Entity Component System. Works well with Object Orientation.
]],
homepage = "https://github.com/bakpakin/tiny-ecs",
license = "MIT"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "builtin",
modules = {
tiny = "tiny.lua"
}
}
+2 -1
View File
@@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-- @author Calvin Rose -- @author Calvin Rose
-- @license MIT -- @license MIT
-- @copyright 2015 -- @copyright 2015
local tiny = { _VERSION = "1.1-2" } local tiny = { _VERSION = "1.1-3" }
-- Local versions of standard lua functions -- Local versions of standard lua functions
local tinsert = table.insert local tinsert = table.insert
@@ -720,6 +720,7 @@ worldMetaTable = {
addSystem = tiny.addSystem, addSystem = tiny.addSystem,
remove = tiny.remove, remove = tiny.remove,
removeEntity = tiny.removeEntity, removeEntity = tiny.removeEntity,
removeSystem = tiny.removeSystem,
update = tiny.update, update = tiny.update,
clearEntities = tiny.clearEntities, clearEntities = tiny.clearEntities,
clearSystems = tiny.clearSystems, clearSystems = tiny.clearSystems,