Class ObstacleFactory

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

public class ObstacleFactory extends Object
Factory to create obstacle entities.

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

  • Method Details

    • createTree

      public static Entity createTree()
      Creates a tree entity.
      Returns:
      entity
    • createTree

      public static Entity createTree(String image)
      Creates a tree entity. Overloading used for save/load game
      Returns:
      entity
    • createRock

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

      public static Entity createRock(String image)
      Creates a rock entity. Overloading used for the purpose of save/load game
      Returns:
      entity
    • createVine

      public static Entity createVine()
      Creates a vine entity, which slows players down
      Returns:
      entity
    • createSpikyTree

      public static Entity createSpikyTree()
      Creates a spiky tree entity, which damages players and knocks them back on contact
      Returns:
      entity
    • createGeyser

      public static Entity createGeyser()
      Creates a geyser, which damages and knocks back the player
      Returns:
      entity
    • createBillboard

      public static Entity createBillboard()
      Creates a Billboard entity, which knocks players back on contact
      Returns:
      entity
    • createPillar

      public static Entity createPillar()
      creates a pillar entity
      Returns:
      entity
    • createWoodenFence

      public static Entity createWoodenFence()
      creates a wooden fence entity
      Returns:
      entity
    • createShipwreckFront

      public static Entity createShipwreckFront()
      creates a shipwreck entity (front)
      Returns:
      entity
    • createShipwreckBack

      public static Entity createShipwreckBack()
      creates a shipwreck entity (back)
      Returns:
      entity
    • createShell

      public static Entity createShell()
    • createWall

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