AI Class
A component class responsible for Artificial Intelligence.
Constructor
AI
-
friendCollideWith
-
foeCollideWith
Parameters:
-
friendCollideWith
NumberA bit mask used when querying the physics engine for friendly entities.
-
foeCollideWith
NumberA bit mask used when querying the physics engine for enemy entities.
Item Index
Methods
addScript
-
script
Adding a script object to the AI component causes the component's entity to be processed with the corresponding script function if all other required components are present.
Parameters:
-
script
ObjectA script object.
getFoeCollideWith
()
Number
Returns:
getFriendCollideWith
()
Number
Returns:
getScript
-
scriptConstructor
Retrieves a script object.
Parameters:
-
scriptConstructor
FunctionConstructor of the script object.
Returns:
hasScript
-
scriptConstructor
Checks if the component has a script attached.
Parameters:
-
scriptConstructor
FunctionConstructor of the script object.
Returns:
removeScript
-
scriptConstructor
Removes a script object and thus cases the entity to no longer be handled by the corresponding script function.
Parameters:
-
scriptConstructor
FunctionConstructor of the script object to be removed.
setFoeCollideWith
-
foeCollideWith
Parameters:
-
foeCollideWith
NumberA bit mask used when querying the physics engine for enemy entities.
setFriendCollideWith
-
friendCollideWith
Parameters:
-
friendCollideWith
NumberA bit mask used when querying the physics engine for friendly entities.