Class ObstacleFactory
java.lang.Object
com.csse3200.game.entities.factories.ObstacleFactory
Factory to create obstacle entities.
Each obstacle entity type should have a creation method that returns a corresponding entity.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic EntitycreateAsteroid(float width, float height) Creates an Asteroid that has bouncestatic EntitycreateAsteroid(AsteroidConfig config) Creates an Asteroid that has bounce from configstatic EntitycreateBorder(float width, float height) static PlaceableEntitycreateCustomTurret(TurretType type, Entity player) static PlaceableEntitycreateCustomTurret(TurretConfig config) static EntityCreates a visible obstaclestatic EntitycreateEnvironment(float sizeX, float sizeY, float posX, float posY) Creates an obstacle with a custom sized collision boxstatic EntitycreateObstacleEnemy(float width, float height) static EntitycreateObstacleEnemy(BaseEntityConfig config) Create an obstacle enemy to match given config filestatic EntitycreateObstacleGameGoal(float width, float height) static Entitystatic EntitycreateStaticAsteroid(float width, float height) static EntitycreateStaticAsteroid(AsteroidConfig config) Create a new static asteroid from the given config filestatic EntityCreates a tree entity.static EntitycreateTree(BaseEntityConfig config) Creates a tree entity.static EntitycreateTreeTop(TreeTopConfig treeTopConfig) Creates a tree top entity.static EntitycreateWall(float width, float height) Creates an invisible physics wall.
-
Field Details
-
WALL_SIZE
public static float WALL_SIZE -
terrain
-
-
Method Details
-
createTree
Creates a tree entity.- Returns:
- entity
-
createTree
Creates a tree entity.- Returns:
- entity
-
createEnvironment
Creates a visible obstacle- Returns:
- Environment entity
-
createEnvironment
Creates an obstacle with a custom sized collision box- Parameters:
sizeX- the length of the new collision boxsizeY- the height of the new collision boxposX- the relative x coordinate of the top left corner of the collision boxposY- the relative y coordinate of the top left corner of the collision box- Returns:
- Environment entity with the set collision box
-
createTreeTop
Creates a tree top entity.- Returns:
- entity
-
createWall
Creates an invisible physics wall.- Parameters:
width- Wall width in world unitsheight- Wall height in world units- Returns:
- Wall entity of given width and height
-
createAsteroid
Creates an Asteroid that has bounce from config- Parameters:
config- Configuration file to match asteroid to- Returns:
- Asteroid entity
-
createAsteroid
Creates an Asteroid that has bounce- Parameters:
width- Asteroid width in world unitsheight- Asteroid height in world units- Returns:
- Asteroid entity of given width and height
-
createStaticAsteroid
Create a new static asteroid from the given config file- Parameters:
config- Configuration file to match asteroid to- Returns:
- Asteroid Entity
-
createBorder
-
createStaticAsteroid
-
createObstacleEnemy
Create an obstacle enemy to match given config file- Parameters:
config- Configuration file to match enemy to- Returns:
- ObstacleEnemy
-
createObstacleEnemy
-
createObstacleGameGoal
-
createObstacleGameGoal
-
createCustomTurret
-
createCustomTurret
-