![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Atomic task that moves an entity toward a 2D target position. More...
#include "../../IAtomicTask.h"
Include dependency graph for Task_GotoPosition.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Classes | |
| class | Olympe::Task_GotoPosition |
| Moves an entity toward a 2D (TargetX, TargetY) destination. More... | |
Namespaces | |
| namespace | Olympe |
| < Provides AssetID and INVALID_ASSET_ID | |
Atomic task that moves an entity toward a 2D target position.
Task_GotoPosition moves the entity toward (TargetX, TargetY) each frame. In headless mode it integrates the entity's "Position" key in the LocalBlackboard using ctx.DeltaTime. In World mode it writes Velocity to the MovementComponent via the ComponentFacade.
Parameters (ParameterMap): "TargetX" (Float) — X coordinate of the destination (required). "TargetY" (Float) — Y coordinate of the destination (required). "Speed" (Float) — Movement speed in units/s (optional, default 300.0).
Returns: Running while the entity is more than 5 units from the target. Success once the entity arrives (distance <= 5 units). Success immediately when ctx.World is nullptr (headless/test mode). Failure if "TargetX" or "TargetY" parameters are missing.
C++14 compliant - no C++17/20 features.
Definition in file Task_GotoPosition.h.