Skip to content

Minimap

Kelvin Hsu edited this page Oct 8, 2026 · 4 revisions

Minimap Component

Usage

The minimap is a UIComponenet that can be given to the player, to then be rendered by the RenderService

  void attachMinimap() {
    var minimap = new Minimap(currentConfig, clearedRoomIds);
    player.addComponent(minimap);
  }

For the minimap to work you are required to provide a RoomConfig, and a reference to the cleared dungeonIds. Both should be provided by the RoomManager

The minimap also gives the player a listener to the event RoomChanged which is triggered by the RoomManager (or whoever owns the lifetime of the player)

Note

The minimap is not given to the room entities, since it lifetime should stay with the player since rooms are destroyed after it is switched out.

UML Class Diagram

classDiagram
    PlayerEntity "1" *-- "0..1" Minimap
    Minimap "1" *-- "3" Table
    Table  *-- "0..*" Actor
    RoomManager *-- PlayerEntity : attaches minimap to player
    RoomManager --> Minimap : "constructs minimap for player"
    Minimap --> EventManager
    PlayerEntity *-- EventManager
    RoomManager --> EventManager : coordinates room change events

    class Minimap {
        - String startingRoomId
        - RoomConfig currentRoom
        - Set~String~ clearedRooms
        - ShapeRenderer
        - Table left
        - Table right
        - Table center
        + void onRoomChanged(RoomConfig room)
        - void rebuild()
        - Table buildRoom()
    }

    class Table {
        - List~Actor~ Children
        + void clearChildren()
    }
    
    UIComponent <|-- Minimap
    class UIComponent {
        # Stage stage
        + void draw()
    }


    Actor <|-- ShapeActor
    Actor <|-- Image

    class Actor {
        <<abstract>>
    }

    class ShapeActor {
        - ShapeRenderer shape
    }
Loading

Sequence Diagram

sequenceDiagram
    actor Player
    Player->>RenderService: Starts Game

    Player->>RoomManager: Interacts with room
    RoomManager->>EventManager: trigger("RoomChanged", destinationRoom)
    EventManager->>Minimap: onRoomChange(destinationRoom)
    Minimap->>Table: clearChildren()
    Table->>RenderService: draw()
    
    RenderService->>Player: updates screen
Loading

Table of Contents

Home

Test Plan

Team 2

Features

Components
Player
Items and Inventory
Enemies
Interactable NPCs
Cutscenes and Dialogue
Music
Bosses
Rooms
Weapons
Abilities & Spells
Game Screens and Areas
Dungeons

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally