Friday, August 26, 2022
HomeGame Developmententity element system - In ECS, how one can lower well being?

entity element system – In ECS, how one can lower well being?


I spent an excellent period of time attempting to get my head round ECS however the “S” continues to be obscure to me – the farthest I went is that I do know a System is the place the magic occurs; it is the place behaviors get carried out, largely.

Nonetheless, most references I examine ECS had been fairly broad of their examples and did not go a lot past the “Motion” and “Physics” Techniques.

That mentioned, what does a system {that a} decreases well being appear to be? My area is TypeScript, however examples/snippets in any language work simply fantastic.

I believe the above is tough for me to visualise largely as a result of my present understanding of ECS is sort of as follows:

  • An Entity is a novel ID that represents a factor,
  • Every Entity has a “assortment” of elements, that describes what the Entity consists of and are nothing however knowledge,
  • All spawned entities are cached in reminiscence, often by way of a “World” object,
  • An Entity is given a Well being element by way of a world.addComponent(entity, well being) perform name,
  • Then, to lower the Well being of this Entity I simply spawned, I might need to…? That is the place issues get blurry and darkish for me – with out the crucial considering well being.decreaseBy(10), the System simply doesn’t “click on”.
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments