Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ecs::Damage Struct Reference

How much damage an entity deals to what it hits. More...

#include <aegis2d/ecs/components.hpp>

Public Attributes

std::int32_t amount = 1
 Health points removed from the target by one hit.
 
bool consumed_on_hit = true
 true if the entity disappears after its first hit (missiles).
 

Detailed Description

How much damage an entity deals to what it hits.

Used with Collider masks: when an entity with Damage hits an entity with Health (see ecs::apply_damage()), the target loses amount points. A missile is consumed by its first hit; a player that rams an enemy is not.

Member Data Documentation

◆ amount

std::int32_t aegis2d::ecs::Damage::amount = 1

Health points removed from the target by one hit.

◆ consumed_on_hit

bool aegis2d::ecs::Damage::consumed_on_hit = true

true if the entity disappears after its first hit (missiles).


The documentation for this struct was generated from the following file: