-
Notifications
You must be signed in to change notification settings - Fork 20
Spread System
Daan van Yperen edited this page Aug 8, 2015
·
3 revisions
Optimally spread out entity operations but still ensure a fixed interval between calls.
Drop in replacement for EntityProcessingSystem
.
Best used to spread out work over multiple frames to obtain a more steady frame rate.
Iteration speed increases/decreases based on the number of entities.
public class MyPacedSystem extends PacedProcessingSystem {
public MyPacedSystem(Aspect.Builder aspect) {
super(aspect, 0.25f); // 250ms
}
@Override
protected void process(Entity e) {
doAction(e); // called every 250ms
}
}