TECS

pub.dev GitHub

An archetype-based Entity Component System (ECS) written in Dart.

📖 Documentation

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

🚀 Made with TECS

LunaPulse — A space shmup built with TECS + Tremble.