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 EntityCreates a Billboard entity, which knocks players back on contactstatic EntityCreates a geyser, which damages and knocks back the playerstatic Entitycreates a pillar entitystatic EntityCreates a rock entity.static EntitycreateRock(String image) Creates a rock entity.static Entitystatic Entitycreates a shipwreck entity (back)static Entitycreates a shipwreck entity (front)static EntityCreates a spiky tree entity, which damages players and knocks them back on contactstatic EntityCreates a tree entity.static EntitycreateTree(String image) Creates a tree entity.static EntityCreates a vine entity, which slows players downstatic EntitycreateWall(float height, float scalex, float scaley) Creates an invisible physics wall.static Entitycreates 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
-