Releases: DickerDackel/tinyecs
v0.3.2
v0.3.1
v0.3.1
- New function
purge_by_property - linter fixes, slight optimizations
v0.3.0
v0.3.0
- Properties!
From the new section in README.md:
Properties
Properties are a new addition to tinyecs. Until now, the only way to mark an
entity to be of a specific type, or have a special feature, was to add a flag
component, e.g.
ecs.add_component(eid, 'is-drawable', True)while not pretty, this does the job, but has the problem that you now need
different systems for times when you do want to filter, and if you don't want
to, since that flag component is added to the arguments of the system.
To solve this, properties (as inspired by Lisp) have been added. These are
"flags" that live outside the component registry. They will not be handed
over to the system when used in run_system.
You can add, remove, and check for them like this:
ecs.set_property(eid, 'is-drawable')
ecs.has_property(eid, 'is-drawable') # --> True
ecs.remove_property(eid, 'is-drawable')The tinyecs functions that return multiple entities and components now support
filtering by these properties.
ecs.run_system(dt, 'position', 'sprite', has_properties{'is-drawable'})
ecs.has(eid, has_properties={'is-sprite'})
result = ecs.eids_by_cids('position', 'sprite',
has_properties={'is-drawable'})
result = ecs.comps_of_archetype('position', 'sprite',
has_properties={'is-drawable', ...})This way, e.g. sprites can now be layered by filtering for the different
types:
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'is-enemy'))
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'bullet'))
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'fx'))
ecs.run_system(0, render_sprites, 'position', 'sprite', has_properties={'hud'))Finally, properties can be searched directly, e.g. to prune dead entities:
for eid in ecs.eid_by_property('is-dead'):
ecs.remove_entity(eid)v0.2.10
v0.2.10
- Fixed docs
v0.2.9
v0.2.9
- Follow API change in pgcooldown
- Simplified archetype creation
- global was bullshit there
- Formatting fixes (hopefully)
v0.2.8
v0.2.8
- Tutorial!
v0.2.7
v0.2.7
- Archetypes!
- More test objects, better readable output
- FPS in titlebar and release boxes on mouseclick
- Just standardized the FPS display in the titlebar
v0.2.6
v0.2.6
- Removed double function is_eid
- Fix for pygame.transform.rotozoom changing the surface type
- New function cid_of_comp
- Merge branch 'main' of https://github.com/dickerdackel/tinyecs
- The interface to deadzone_system was b0rken
v0.2.5
v0.2.5
- The interface to deadzone_system was b0rken
- typos and clarifications
- Merge branch 'main' of https://github.com/dickerdackel/tinyecs
v0.2.4
v0.2.4
- Friction system added
- Use locking in RSAI, round RSA to allow caching
- Renamed components to compsys, backward compat preserved
- Added default wildcard exports
- Removed fragment of no longer existing code
- Added registry healthcheck
- tinyecs.has added