aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/AI.h
diff options
context:
space:
mode:
authormax-001 <maxsmits21@kpnmail.nl>2024-12-10 17:52:46 +0100
committermax-001 <maxsmits21@kpnmail.nl>2024-12-10 17:52:46 +0100
commit543dc375228b520605bb099bc95a23918f75e9f8 (patch)
tree627f14f37b68bc4009001ee659f9fba87be9010a /src/crepe/api/AI.h
parent6fc38e15e4b88d480d5fcb69eec36f7d8685e853 (diff)
Implemented feedback
Diffstat (limited to 'src/crepe/api/AI.h')
-rw-r--r--src/crepe/api/AI.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/crepe/api/AI.h b/src/crepe/api/AI.h
index d48d9df..80feda5 100644
--- a/src/crepe/api/AI.h
+++ b/src/crepe/api/AI.h
@@ -14,8 +14,7 @@ namespace crepe {
class AI : public Component {
public:
//! The different types of behaviors that can be used
- enum BehaviorType {
- NONE = 0x00000,
+ enum BehaviorTypeMask {
SEEK = 0x00002,
FLEE = 0x00004,
ARRIVE = 0x00008,
@@ -35,7 +34,7 @@ public:
* \param behavior The behavior to check
* \return true if the behavior is on, false otherwise
*/
- bool on(BehaviorType behavior) const { return (flags & behavior) == behavior; }
+ bool on(BehaviorTypeMask behavior) const { return (flags & behavior); }
//! Turn on the seek behavior
void seek_on() { flags |= SEEK; }
//! Turn off the seek behavior
@@ -92,8 +91,10 @@ public:
//! The maximum force that can be applied to the entity (higher values will make the entity adjust faster)
float max_force;
- //! The target to seek or arrive at
+ //! The target to seek at
vec2 seek_target;
+ //! The target to arrive at
+ vec2 arrive_target;
//! The target to flee from
vec2 flee_target;
//! The distance at which the entity will start to flee from the target