Class NPCFactory

java.lang.Object
com.deco2800.game.entities.factories.NPCFactory

public class NPCFactory
extends java.lang.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

    • createFaceWorm

      public static Entity createFaceWorm​(Entity target)
      Creates a Face Worm.
      Parameters:
      target - entity to chase
      Returns:
      entity
    • createFlyingMonkey

      public static Entity createFlyingMonkey​(Entity target)
      Create Flying Monkey
    • createSpaceShip

      public static Entity createSpaceShip​(Entity target)
      Create Spaceship
      Parameters:
      target - the player entity
      Returns:
      this spaceship entity
    • createSmallMissile

      public static Entity createSmallMissile​(Entity target)
      Create a missile
      Parameters:
      target - the player entity
      Returns:
      this missile entity