Class ObstacleFactory

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

public class ObstacleFactory
extends java.lang.Object
Factory to create obstacle entities.

Each obstacle entity type should have a creation method that returns a corresponding entity.

  • Method Details

    • createPlantsObstacle

      public static Entity createPlantsObstacle​(Entity target)
      Creates a Plants Obstacle.
      Parameters:
      target - character.
      Returns:
      the plants obstacle entity
    • createThornsObstacle

      public static Entity createThornsObstacle​(Entity target)
      Creates a Thorns Obstacle.
      Parameters:
      target - character.
      Returns:
      the thorns obstacle entity
    • createWeapon

      public static Entity createWeapon()
      Creates a Weapon attack effect for player.
    • createMeteorite

      public static Entity createMeteorite​(Entity target, float size, ObstacleFactory.MeteoriteType meteoriteType)
      Creates a Meteorite
      Parameters:
      target - character.
      Returns:
      the meteorite obstacle entity
    • createPortal

      public static Entity createPortal​(Entity target, ObstacleEventHandler.ObstacleType type)
      Creates a Thorns Obstacle.
      Parameters:
      target - character.
      Returns:
      the thorns obstacle entity
    • createWall

      public static Entity createWall​(float width, float height, short layer)
      Creates an invisible physics wall.
      Parameters:
      width - Wall width in world units
      height - Wall height in world units
      Returns:
      Wall entity of given width and height
    • createRock

      public static Entity createRock()
      Creates a rock.
      Returns:
      Rock entity
    • createMagma

      public static Entity createMagma​(Entity target)
      Creates a firerock.
      Returns:
      Firrerock entity
    • createNail

      public static Entity createNail​(Entity target)
      Creates a nail.
      Returns:
      nail entity
    • createWood

      public static Entity createWood()
      Creates a wood.
      Returns:
      Wood entity