Skip to content
Daan van Yperen edited this page Aug 8, 2015 · 3 revisions

SpreadProcessingSystem

Optimally spread out entity operations but still ensure a fixed interval between calls.

Details

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.

Example

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
	}
}