ComponentSpawner constructor

ComponentSpawner({
  1. required Vector2 position,
  2. required ShapeHitbox area,
  3. required int interval,
  4. required SpawnerPositionBuilder builder,
  5. bool spawnCondition(
    1. BonfireGameInterface game
    )?,
  6. bool onlyVisible = true,
})

Implementation

ComponentSpawner({
  required Vector2 position,
  required this.area,
  required this.interval,
  required this.builder,
  this.spawnCondition,
  this.onlyVisible = true,
}) {
  _random = Random();
  this.position = position;
  size = area.size;
}