Skip to content

MinimapComponent

rjg1 edited this page Aug 24, 2022 · 6 revisions

Introduction

In order to keep track of the flow of the game, the map is condensed into a small minimap at the bottom right corner of the screen. This allows users to easily take stock of the state of the game, given the size of the map, by viewing where their buildings, allied units and enemies are relative to their current view.

The Minimap is displayed through the MinimapComponent, which extends RenderComponent in order to be visualised in-game. It must currently be attached to the terrain Entity, which is currently generated in AtlantisGameArea, and should hold both a TerrainComponent and a MinimapComponent.

The Minimap component will automatically render the game map once attached, set to layer 2, so it will render on top of the player and the terrain (which are on layers 1 and 0 respectively).

Usage

Creating a Minimap Component

The Minimap Component requires the TerrainComponent's TiledMap and the current game camera to be constructed. These can both be accessed as follows:

//Create map
terrain = terrainFactory.createAtlantisTerrainComponent();
//Add minimap component
MinimapComponent minimapComponent = new MinimapComponent(terrain.getMap(), (OrthographicCamera) terrainFactory.getCameraComponent().getCamera());

This will instantiate a new MinimapComponent, loaded with the current TiledMap associated with the TerrainComponent "terrain"

Creating the terrain entity which will display the game terrain and minimap

spawnEntity(new Entity().addComponent(terrain).addComponent(minimapComponent));

Will create the desired entity, after both components have been created.

Adjusting the Minimap size

If it is desired to make the Minimap smaller or larger, while retaining it's relative scale, the "MINIMAP_SCALE" constant may be adjusted in the MinimapComponent.java class.

e.g to double the Minimap size:

    /**
     * Scale the Minimap in size multiplicatively
     */
    private final float MINIMAP_SCALE = 2f;

Table of Contents

Home

Game

Game Home

Design Influences

Gameplay Features

Style

Story

Friendly Units
Map
City
Buildings
Unit Selections

Spell

Game User Testing: Theme of Unit Selection & Spell System

UI User Testing

Tutorial

Resource Stats Display

Loading Screen Bar

Health Bars
In Game menu
  • Feature
  • User Testing:In Game Menu

Landscape Tile Design

Landscape Tile Design Feedback

Weather Design

Weather Design Feedback

Camera Movement

Enemy design

Enemy Units

Enemy AI

How Animation Works

Map Flooding

Game Engine

Getting Started

Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally