Class ProjectileFactory

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

public class ProjectileFactory extends Object
Factory to create non-playable projectile entities with predefined components.

Each projectile entity type has a creation method that returns a corresponding entity. Predefined entity properties can be loaded from configurations stored as JSON files defined in "NPCConfigs". This factory can be expanded or separated into more specific factories for entities with similar characteristics.

  • Method Details

    • createBanana

      public static Entity createBanana(Entity target)
      Creates a banana projectile entity (for monkey).

      This projectile will chase the specified target entity, such as a player, using predefined AI tasks and animations.

      Parameters:
      target - The entity that the projectile will target and chase.
      Returns:
      A new banana projectile entity.
    • createWaterSpiral

      public static Entity createWaterSpiral(Entity target)
    • createWindGust

      public static Entity createWindGust(Entity target)
    • createElectricOrb

      public static Entity createElectricOrb(Entity target)
      Creates an orb projectile entity (for eel).

      This projectile will chase the specified target entity, such as a player, using predefined AI tasks and animations.

      Parameters:
      target - The entity that the projectile will target and chase.
      Returns:
      A new orb projectile entity.
    • createWorm

      public static Entity createWorm(Entity target)
      Creates an worm projectile entity (for eel).

      This projectile will chase the specified target entity, such as a player, using predefined AI tasks and animations.

      Parameters:
      target - The entity that the projectile will target and chase.
      Returns:
      A new worm projectile entity.
    • createHive

      public static Entity createHive(Entity target, List<Entity> enemies)
      Creates a hive enemy.
      Parameters:
      target - entity which the spawned bees will chase
      Returns:
      enemy hive entity