GithubHelp home page GithubHelp logo

ecs's People

Contributors

abiee avatar oza94 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ecs's Issues

Ability to disable a system

Here is my (hypothetical, not actually implemented) simplified use case: in my game, when you click a button, all my physical entities explode, which results in their positions being modified.
To achieve this, I create an entity whenever I receive the event of the click of the button, with a component that marks that all entities should explode.
I have a system that reacts to this entity. When it's present, it creates an ExplosionSystem which is responsible for updating the physical entities' positions. If it's not present, and the system is known by ECS, it removes it.

This approach has a few shortcomings:

  1. the eligibility of components to the ExplosionSystem is lost when you remove it, which is bad for performance
  2. the ExplosionSystem is not reusable, and is needlessly recreated
  3. the ExplosionSystem can only be added after all the other systems

This is my example, but it can be generalized to any case where an event results into the update of multiple different components.

It seems to me that if you were able to do mySystem.disable() and mySystem.enable(), all those problems would disappear. It would just be a matter of setting a flag on the disabled systems and checking that it's not present when updating the systems.

It's my first time using ECS, so maybe there is a better approach. I heard about it in this video about Entitas.

Typo on line 15 of the example

Looks like a really nice lib.
Tiny typo in the example that drives me a bit insane.

I do believe that you mean
class KeyboardControlSystem extends ECS.System {
and not
class KeyboardControlSystem extends ECS.Sytem {

Sorry if it seems like I'm nitpicking, but I felt like I ought to let you guys know.

Version 1.1.0 is not documented

on npmjs.org, yagl-ecs 1.1.0 has been released. On github, the version is still 1.0.0, leaving the new version undocumented as the source is the only documentation. Please update the source on github.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.