Home Game Development entity element system – In ECS, easy methods to lower well being?

entity element system – In ECS, easy methods to lower well being?

0
entity element system – In ECS, easy methods to lower well being?

[ad_1]

I spent a great period of time making an attempt 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, principally.

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

That stated, what does a system {that a} decreases well being appear like? My area is TypeScript, however examples/snippets in any language work simply high quality.

I believe the above is difficult for me to visualise principally as a result of my present understanding of ECS is kind of as follows:

  • An Entity is a singular ID that represents a factor,
  • Each Entity has a “assortment” of parts, that describes what the Entity consists of and are nothing however knowledge,
  • All spawned entities are cached in reminiscence, normally by a “World” object,
  • An Entity is given a Health element by a world.addComponent(entity, well being) operate name,
  • Then, to lower the Health of this Entity I simply spawned, I’d need to…? This 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”.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here