Class ObstacleFactory
java.lang.Object
com.deco2800.game.entities.factories.ObstacleFactory
Factory to create obstacle entities.
Each obstacle entity type should have a creation method that returns a corresponding entity.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Entity
Creates a Billboard entity, which knocks players back on contactstatic Entity
Creates a geyser, which damages and knocks back the playerstatic Entity
creates a pillar entitystatic Entity
Creates a rock entity.static Entity
createRock
(String image) Creates a rock entity.static Entity
static Entity
creates a shipwreck entity (back)static Entity
creates a shipwreck entity (front)static Entity
Creates a spiky tree entity, which damages players and knocks them back on contactstatic Entity
Creates a tree entity.static Entity
createTree
(String image) Creates a tree entity.static Entity
Creates a vine entity, which slows players downstatic Entity
createWall
(float height, float scalex, float scaley) Creates an invisible physics wall.static Entity
creates a wooden fence entity
-
Method Details
-
createTree
Creates a tree entity.- Returns:
- entity
-
createTree
Creates a tree entity. Overloading used for save/load game- Returns:
- entity
-
createRock
Creates a rock entity.- Returns:
- entity
-
createRock
Creates a rock entity. Overloading used for the purpose of save/load game- Returns:
- entity
-
createVine
Creates a vine entity, which slows players down- Returns:
- entity
-
createSpikyTree
Creates a spiky tree entity, which damages players and knocks them back on contact- Returns:
- entity
-
createGeyser
Creates a geyser, which damages and knocks back the player- Returns:
- entity
-
createBillboard
Creates a Billboard entity, which knocks players back on contact- Returns:
- entity
-
createPillar
creates a pillar entity- Returns:
- entity
-
createWoodenFence
creates a wooden fence entity- Returns:
- entity
-
createShipwreckFront
creates a shipwreck entity (front)- Returns:
- entity
-
createShipwreckBack
creates a shipwreck entity (back)- Returns:
- entity
-
createShell
-
createWall
Creates an invisible physics wall.- Parameters:
height
- Wall height in world units- Returns:
- Wall entity of given width and height
-