TERRAIN FACTORY - UQcsse3200/2024-studio-1 GitHub Wiki
Overview
The TerrainFactory class is responsible for creating and managing the terrain in the game. It generates the visual representation of rooms and levels using tiled maps
Key Components
- MAP_SIZE: Defines the size of the map in grid coordinates.
- camera: The orthographic camera used for rendering.
- currentLevel: Tracks the current level number.
- isBossRoom: Boolean flag to indicate if the current room is a boss room
Core methods
1. createTerrain(TerrainType terrainType, boolean isBossRoom)
- Creates a terrain component based on the specified type and whether it's a boss room.
2. createRoomTerrain(float tileWorldSize, TextureRegion[] tileSet)
- Generates a room terrain using the provided tile set.
3. createRoomTiles(GridPoint2 tileSize, TextureRegion[] tileSet)
- Creates the tiled map for a room.
4. fillTiles(TiledMapTileLayer layer, GridPoint2 mapSize, TerrainTile[] tileList)
- Fills the tile layer with appropriate tiles, including boundary, broken, and stained tiles.