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

Entity destroyed once it has left the play area for good. More...

#include <aegis2d/ecs/components.hpp>

Public Attributes

float margin = 0.0F
 Distance beyond each edge of the area, in logical pixels, before the entity counts as gone.
 

Detailed Description

Entity destroyed once it has left the play area for good.

Missiles and enemies get it, so none of them outlives the screen: ecs::despawn_outside() destroys the entity when its box is entirely outside the area grown by margin and its velocity does not bring it back. An enemy created beyond the right edge and flying left is kept until it has crossed the screen; the margin keeps an entity whose path briefly leaves the screen (a sine wave) alive.

Member Data Documentation

◆ margin

float aegis2d::ecs::OffscreenDespawn::margin = 0.0F

Distance beyond each edge of the area, in logical pixels, before the entity counts as gone.


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