Class MazeTerrainFactory
java.lang.Object
com.csse3200.game.areas.terrain.TerrainFactory
com.csse3200.game.minigames.maze.areas.terrain.MazeTerrainFactory
Factory for creating game terrain for the maze mini-game.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.csse3200.game.areas.terrain.TerrainFactory
TerrainFactory.TerrainType
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.badlogic.gdx.math.GridPoint2
static final float
Fields inherited from class com.csse3200.game.areas.terrain.TerrainFactory
camera, CHUNK_SIZE, orientation
-
Constructor Summary
ConstructorsConstructorDescriptionMazeTerrainFactory
(CameraComponent cameraComponent) Create a terrain factory with Orthogonal orientation -
Method Summary
Modifier and TypeMethodDescriptionCreate terrain for the maze mini-game.static com.badlogic.gdx.math.GridPoint2
worldPosToGridPos
(com.badlogic.gdx.math.Vector2 worldPos) Gets the maze grid cell containing the given point in world coordinates.Methods inherited from class com.csse3200.game.areas.terrain.TerrainFactory
createRenderer, createTerrain, getCameraComponent
-
Field Details
-
MAP_SIZE
public static final com.badlogic.gdx.math.GridPoint2 MAP_SIZE -
TILE_SIZE
public static final float TILE_SIZE- See Also:
-
-
Constructor Details
-
MazeTerrainFactory
Create a terrain factory with Orthogonal orientation- Parameters:
cameraComponent
- Camera to render terrains to. Must be ortographic.
-
-
Method Details
-
createTerrain
Create terrain for the maze mini-game. There is only one Terrain type, the maze background water.- Returns:
- Terrain component which renders the terrain
-
worldPosToGridPos
public static com.badlogic.gdx.math.GridPoint2 worldPosToGridPos(com.badlogic.gdx.math.Vector2 worldPos) Gets the maze grid cell containing the given point in world coordinates.- Parameters:
worldPos
- vector to represent a position in the world- Returns:
- the coordinate of the grid cell this point is contained in
-