Class EnemyFactory

java.lang.Object
com.csse3200.game.entities.factories.EnemyFactory

public class EnemyFactory extends Object
Factory for creating enemy and boss entities. Build enemies via dedicated helpers.
  • Method Details

    • createDrone

      public static Entity createDrone(Entity target, com.badlogic.gdx.math.Vector2 spawnPos)
      Creates a drone enemy that starts idle. When activated by a security camera, starts chasing its target. Has drone-specific animation, combat stats and chase task.
      Parameters:
      target - that drone pursues when chasing
      spawnPos - the starting world position of the enemy
      Returns:
      drone enemy entity
    • createPatrollingDrone

      public static Entity createPatrollingDrone(Entity target, com.badlogic.gdx.math.Vector2[] patrolRoute)
      Same as basic drone enemy but patrols a given route, alternatively chasing a target when activated.
      Parameters:
      target - that drone pursues when chasing
      patrolRoute - contains list of waypoints in patrol route
      Returns:
      a patrolling drone enemy entity
    • createBomberDrone

      public static Entity createBomberDrone(Entity target, com.badlogic.gdx.math.Vector2 spawnPos, String bomberId)
      Create a bomber-style drone with integrated cone light detection. The bomber uses a downward-facing cone light to detect and bomb targets below.
      Parameters:
      target - that drone pursues when bombing/chasing
      spawnPos - the starting world position of the enemy
      bomberId - unique ID for this bomber (used for light registration)
      Returns:
      a bomber drone entity with light detection
    • createPatrollingBomberDrone

      public static Entity createPatrollingBomberDrone(Entity target, com.badlogic.gdx.math.Vector2[] patrolRoute, String bomberId)
      Create a patrolling bomber drone with integrated light detection. The bomber patrols a route and uses its cone light to detect targets below.
      Parameters:
      target - that drone pursues when bombing/chasing
      patrolRoute - array of waypoints defining the patrol route
      bomberId - unique ID for this bomber
      Returns:
      a patrolling bomber drone entity
    • createAutoBomberDrone

      public static Entity createAutoBomberDrone(Entity target, com.badlogic.gdx.math.Vector2[] patrolRoute)
      Create an automatic bomber drone that continuously drops bombs while patrolling. The bomber stays in drop animation and drops bombs every second while moving. The bomb drop task briefly takes priority every second to drop a bomb, then immediately yields back to patrol.
      Parameters:
      target - reference entity (usually player) for bomb direction
      patrolRoute - array of waypoints defining the patrol route
      Returns:
      an automatic bombing patrol drone entity
    • createSelfDestructionDrone

      public static Entity createSelfDestructionDrone(Entity target, com.badlogic.gdx.math.Vector2 spawnPos)
      Create a self-destruction drone variant that chases its target then explodes near the target.
      Parameters:
      target - entity to pursue and self destruct near
      spawnPos - optional spawn position
      Returns:
      a self-destruction drone entity
    • createBossSelfDestructDroneInternal

      public static Entity createBossSelfDestructDroneInternal(Entity target, com.badlogic.gdx.math.Vector2 spawnPos, String atlasPath, float speed, float bombEffectFrameDuration)
      Creates a self-destruct drone variant specifically for boss spawning. Minimal behaviour (no teleport or cooldown functionality). The drone is activated immediately and enters a permanent chase state until exploding.
      Parameters:
      target - entity the player will pursue and explode near
      spawnPos - optional spawn position
      atlasPath - texture atlas path used for drone animations
      speed - max movement speed
      bombEffectFrameDuration - per-frame duration for the bomb_effect
      Returns:
      a constructed self-destruct chase drone
    • createBossSelfDestructDrone

      public static Entity createBossSelfDestructDrone(Entity target, com.badlogic.gdx.math.Vector2 spawnPos)
      Convenience overload for creating a boss-spawned self-destruct drone with default atlas/speed/effect timings (CHASER-like baseline).
      Parameters:
      target - entity to chase
      spawnPos - optional spawn position
      Returns:
      a constructed self-destruct chase drone
    • createBossSelfDestructDrone

      public static Entity createBossSelfDestructDrone(Entity target, com.badlogic.gdx.math.Vector2 spawnPos, EnemyFactory.DroneVariant variant)
      Variant-aware overload for creating a boss self-destruct drone, Selects atlas, speed and bomb effect timing based on variant. Behaviour remains the same for boss-spawned drones: no teleport or cooldown, immediate chase on activation.
      Parameters:
      target - entity to chase
      spawnPos - optional spawn position
      variant - drone variant that determines atlas/speed/effect tuning
      Returns:
      a constructed self-destruct chase drone
    • createBossEnemy

      public static Entity createBossEnemy(Entity target, com.badlogic.gdx.math.Vector2 spawnPos)
      Builds the boss entity for the boss level with core combat/AI/rendering components and a single empty BossSpawnerComponent. Triggers are configured externally in Spawners. - Chases the player - BossLaserAttackComponent for ranged laser attacks - BossTouchKillComponent for player death on contact
      Parameters:
      target - the target entity used by attack and AI components
      spawnPos - optional initial world position
      Returns:
      the constructed boss entity