Class EnemyFactory

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

public class EnemyFactory 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 "EnemyConfigs".

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

  • Method Details

    • createBullet

      public static Entity createBullet(Entity from, Entity target, GameArea gameArea)
      Creates the bullet for the Trebuchet.
      Parameters:
      from - the position of the Trebuchet that the bullet will be created from
      target - the ships that the bullet aim to attack
      gameArea - the game area
      Returns:
      the bullet entity of Trebuchet.
    • createBlueJoker

      public static Entity createBlueJoker(AtlantisTerrainFactory terrainFactory)
      Creates a Blue Joker enemy entity
      Returns:
      Blue Joker enemy entity
    • createSnake

      public static Entity createSnake(AtlantisTerrainFactory terrainFactory)
      Creates a Snake entity
      Returns:
      Snake entity
    • createWolf

      public static Entity createWolf(AtlantisTerrainFactory terrainFactory)
      Creates a wolf entity
      Returns:
      entity
    • createTitan

      public static Entity createTitan(AtlantisTerrainFactory terrainFactory)
      Creates a titan entity
      Returns:
      entity