![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Atomic AI task that moves an entity away from a 2D threat position. More...
#include "../../IAtomicTask.h"
Include dependency graph for Task_Flee.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | Olympe::Task_Flee |
| Moves an entity away from a 2D threat position until safe distance is reached. More... | |
Namespaces | |
| namespace | Olympe |
| < Provides AssetID and INVALID_ASSET_ID | |
Atomic AI task that moves an entity away from a 2D threat position.
Task_Flee computes a flee direction opposite to the threat (TargetX, TargetY) and moves the entity away from it. Returns Running while the entity is closer than Distance to the threat; returns Success once the entity is far enough away.
Parameters (ParameterMap): "TargetX" (Float) — X coordinate of the threat (required). "TargetY" (Float) — Y coordinate of the threat (required). "Distance" (Float) — safe flee distance in units (optional, default 200.0).
Returns: Running while the entity's distance to the threat < Distance. Success once the entity's distance to the threat >= Distance. Failure if "TargetX" or "TargetY" are missing.
C++14 compliant - no C++17/20 features.
Definition in file Task_Flee.h.