-
Notifications
You must be signed in to change notification settings - Fork 113
System
Systems encapsulate game logic, typically operating on a family of entities.
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.
Implement one of these:
-
BaseSystem - Blank, invoked by
world.process()
-
EntitySystem - Subscribes to matching entities.
-
EntityProcessingSystem - Iterates over matching entities.
- IntervalEntityProcessingSystem - .. with fixed interval.
- DelayedEntityProcessingSystem - .. with varied interval.
-
EntityProcessingSystem - Iterates over matching entities.
-
EntitySystem - Subscribes to matching entities.
Register with WorldConfiguration#setSystem before passing it to World.
Your registered systems are called in the order added to WorldConfiguration.
Systems can access other systems. Simply expose methods and use @Wire.
Override #initialize()
to initialize your system, not your constructor. Initialize is called after dependency injection.
class MySystem extends BaseSystem {
@Override
public initialize()
{
// custom initialization.
}
}
Override checkProcessing
to return false if you want to skip the system during processing.
You can override inserted
and removed
methods in EntitySystem and derived classes. There you will be notified about entity changes.
- Overview
- Concepts
- Getting Started
- Using
- More guides
- Plugins
- Game Gallery
- Tools and Frameworks
- API reference