- A physics system acts on all entities that have a mass and position component
- A regen system acts on all entities that have a health component
- A player movement system acts on all entities that have a position component
Registering Systems
Before your systems can run, you need to register them with the world usingcardinal.RegisterSystem()
.
Hook | When it runs |
---|---|
cardinal.WithHook(cardinal.Init) | Once during world initialization (only once at tick 0), before any game loop starts |
cardinal.WithHook(cardinal.PreUpdate) | Every tick, before the main update phase |
cardinal.WithHook(cardinal.Update) | Every tick, during the main update phase (this is the default if no hook is specified) |
cardinal.WithHook(cardinal.PostUpdate) | Every tick, after the main update phase |