MAP system - UQcsse3200/2024-studio-1 GitHub Wiki
The map system in Beast Breakout is designed to create dynamic, replayable levels while maintaining a consistent atmosphere and gameplay experience. It utilizes a seed-based randomization system to generate unique layouts for each playthrough.
Key Components
Map Configuration
Describes the structure of map configurations, including:
- Room connections
- Room Directions
- Seed
- Map size
MapFactory Class
Seed-Based Randomization
The map system uses a random seed to determine:
- Number and location of doors in each room
- Animal sets for each room
- Item drops
- Ending room location
Map Structure
Maps consist of various rooms and each of those rooms are connected via doors, with locations determined by the seed The system reuses similar room layouts with different enemy configurations to extend gameplay.
Grid Rendering
GridRenderer extends OrthogonalTiledMapRenderer to provide additional grid overlay functionality.
Key Features
- Renders the base tiled map
- Draws a grid overlay on top of the map
- Adjusts to the camera and map scale
Class Structure
render()
: Overrides the base render method to include grid drawing
drawGrid()
: Draws the grid lines over the map
ShapeRenderer
for efficient line drawing
**Usage**
Blackout Component
The BlackoutComponent is a rendering component that creates a blackout effect in the game, useful for transitions between rooms Key Features
- Extends RenderComponent for integration with the game's rendering system
- Uses ShapeRenderer to draw the blackout effect
- Implements a smooth fade-in and fade-out transition
- Configurable duration for the blackout effect
Class Structure
It uses
ShapeRenderer
to access the render service and stage
It has Fields
, constructors
and methods
respectively in order
**Usage**
Add it to an entity in your game -> Call triggerBlackout(duration)
when you want to activate the effect ->The component will automatically handle the rendering and fading