Skip to content

Building Health Bars

hugh5 edited this page Oct 15, 2022 · 17 revisions

This page refers to friendly building health bars displayed in the UI Box. For friendly units and enemy entity health bars, refer to Entity Health Bars

Building Health Bars

Examples of what the health bars look like.

Stat Display Design Process

The red colour in the progress bar was changed to a lighter red as it was too bright.

Originally the attack and defense progress bar designs were used however it was realised that attack and defense stats are a static metric that do not need progress bars.

It was then decided that icons should be used to represent attack and defense stats of a building

Functionality

The health bars are configured in BuildingUIDataComponent.createHealthBar()

Creation sequence of Building Health Bar

The health bar frame is created as an Image with the texture loaded from the ResourceService.
A 1px wide Pixmap is created which is just a red rectangle that is use for creating the ProgressBarStyle.
This Pixmap is the health which is displayed by the ProgressBar.
A Label is created to display the hit points of the building as well.
The position of the Image, ProgressBar and Label are all configured in this function.
Finally, an event listener is registered to know when the entity's health is updated.

HealthBarComponent_create

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