Skip to content

Entity Health Bars

hugh5 edited this page Oct 14, 2022 · 11 revisions

This page refers to the health bars displayed on the entities in game (this excludes friendly buildings). For Building health bars, refer to Building Health Bars

Health

The health and maxHealth displayed on the health bar are specified by the CombatStatsComponent of that entity.
Each segment represents 25hp in the health (this can be changed).
The health of the entity can be changed through the CombatStatsComponent and same with maxHealth. How these changes effect the health bar can be seen below
The health bar is also scaled to the size of the entity so larger entities like buildings have larger displaying health bars

The Health bars displayed on the entities will hide after a period of inactivity (currently set to 15 seconds).
Inactivity means no changes to health for a period of time.

Health bars can also be turned on to ignore inactivity using the debug on command

What it looks like in game

Friendly entity missing health Increasing max health of friendly entity
Enemy entity missing health Increasing max health of enemy entity
Building Entity Health Bar

Sequence showing the creation of a Health Bar

The HealthBarComponent extends from RenderComponent so it registers itself with the RenderService.
The Health Bar gets the combat stats component to have access to the health of the entity.
The Health Bar then gets the game time to know when to hide the health bar after a time of inactivity.
It finally register an event listener to know when the health of the entity 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