Class NPCFactory

java.lang.Object
com.deco2800.game.entities.factories.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

    • createGhost

      public static Entity createGhost(Entity target)
      Creates a ghost entity.
      Parameters:
      target - entity to chase
      Returns:
      entity
    • createGhostKing

      public static Entity createGhostKing(Entity target)
      Creates a ghost king entity.
      Parameters:
      target - entity to chase
      Returns:
      entity