tecs 1.0.12
tecs: ^1.0.12 copied to clipboard
Simple ECS for dart.
TECS #
An archetype-based Entity Component System (ECS) written in Dart.
class MoveSystem extends System<double> {
final params = QueryParams([PositionComponent, VelocityComponent]);
@override
void update(double deltaTime) {
world.queryEach(params, (row) {
final position = row.get<PositionComponent>();
final velocity = row.get<VelocityComponent>();
position.x += velocity.x * deltaTime;
position.y += velocity.y * deltaTime;
});
}
}