voces / mvp-bd-client

Bulldog on the browser
https://katma.io
1 stars 1 forks source link

Convert setTimout & setInterval into components & systems #62

Open voces opened 3 years ago

voces commented 3 years ago

Using timers in code is error-prone, especially as timers are often tied to specific entities. Instead, we should explicitly tie the timer to the entity via a component. We can then process timers in a system that tracks entities with said components. We can map the existing setTimeout and setInterval to either an implicit entity, or finally have App extend Entity.

voces commented 3 years ago

This components and systems exist and are used, but the old style is still in existence and should be done before closing this out.