java.lang.Object
com.csse3200.game.entities.factories.characters.NPCFactory

public class NPCFactory extends Object
Factory to create non-playable character (NPC) entities with predefined components.

Each NPC entity type should have a creation method that returns a corresponding entity. Predefined entity properties can be loaded from configs stored as json files which are defined in "NPCConfigs".

If needed, this factory can be separated into more specific factories for entities with similar characteristics.

  • Method Details

    • createGhostGPT

      public static Entity createGhostGPT(Entity target, GameArea area, float scalingFactor)
      Creates GhostGPT enemy type
      Parameters:
      target - entity to chase
      area - the area/space it is living in
      scalingFactor - The scale of increase in health and attack of the GhostGPT
      Returns:
      entity
    • createRobot

      public static Entity createRobot(Entity target)
      Creates a robot entity.
      Parameters:
      target - entity to chase (e.g. player)
      Returns:
      robot entity
    • createDeepspin

      public static Entity createDeepspin(Entity target, GameArea area, float scalingFactor)
      Creates Deepspin enemy type
      Parameters:
      target - entity to chase
      area - the area/space it is living in
      scalingFactor - The scale of increase in health and attack of the DeepSpin
      Returns:
      entity
    • createGrokDroid

      public static Entity createGrokDroid(Entity target, GameArea area, float scalingFactor)
      Creates GrokDroid enemy type
      Parameters:
      target - entity to chase
      area - the area/space it is living in
      scalingFactor - The scale of increase in health and attack of the GrokDroid
      Returns:
      entity
    • createVroomba

      public static Entity createVroomba(Entity target, float scalingFactor)
      Creates a Vroomba entity.
      Parameters:
      target - entity to chase
      scalingFactor - The scale of increase in health and attack of the Vroomba
      Returns:
      entity
    • createTurret

      public static Entity createTurret(Entity target, GameArea area, float scalingFactor)
      Creates Turret enemy type
      Parameters:
      target - entity to chase
      area - the area/space it is living in
      scalingFactor - The scale of increase in health and attack of the GhostGPT
      Returns:
      entity