Skip to content
Fabio Ticconi edited this page Aug 19, 2015 · 24 revisions

Systems encapsulate game logic, typically operating on a family of entities.

When?

For an active process you need to model, or stepping over entities that match a certain profile, implement an EntityProcessingSystem, EntitySystem, or any of the other systems.

If you need to serve or organize objects and assets (components, entities, fonts, graphics, sounds), use managers instead. Utility methods can be implemented as either managers or Base entity systems.

How?

Implement one of these:

Register with WorldConfiguration#setSystem before passing it to World.

Good to know

Order of operation

Your registered systems are called in the order added to WorldConfiguration.

Inter-system communication

Systems can access other systems. Simply expose methods and use @Wire.

Initializing your system

Override #initialize() to initialize your system, not your constructor. Initialize is called after dependency injection.

class MySystem extends BaseSystem {
   @Override 
   public initialize() 
   {
      // custom initialization.
   }
}

Skip processing

Override checkProcessing to return false if you want to skip the system during processing.

Entity notifications

You can override inserted and removed methods in EntitySystem and derived classes. There you will be notified about entity changes.

Clone this wiki locally