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.

image

Key Features

  1. Renders the base tiled map
  2. Draws a grid overlay on top of the map
  3. 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**

image

Blackout Component

The BlackoutComponent is a rendering component that creates a blackout effect in the game, useful for transitions between rooms Key Features

  1. Extends RenderComponent for integration with the game's rendering system
  2. Uses ShapeRenderer to draw the blackout effect
  3. Implements a smooth fade-in and fade-out transition
  4. Configurable duration for the blackout effect Class Structure It uses ShapeRenderer to access the render service and stage

image

It has Fields, constructors and methods respectively in order

image

**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

UML DIAGRAM

image