The Table Engine
EnemyAIScript Class Reference

Script to manage enemy artificial intelligence. More...

#include <enemy_ai_script.h>

+ Inheritance diagram for EnemyAIScript:
+ Collaboration diagram for EnemyAIScript:

Public Member Functions

 EnemyAIScript ()
 Constructs a new Enemy AI Script object. More...
 
void update () override
 Updates the behavior of the enemy each frame. More...
 
void render () override
 Renders the enemy AI behavior. More...
 
- Public Member Functions inherited from Script
 Script ()
 Default constructor, initializes an empty script. More...
 
 Script (std::string name)
 Constructs a Script with a specified name. More...
 
virtual ~Script ()
 Virtual destructor to allow for cleanup in derived script classes. More...
 
std::string getName ()
 Retrieves the name of the script. More...
 
GameObjectgetOwner ()
 Retrieves the owner GameObject of this script. More...
 
void setOwner (GameObject *owner)
 Sets the owner of this script. More...
 
virtual void input ()
 Virtual method for handling input. Should be overridden by derived classes. More...
 

Private Attributes

float m_speed = 2
 

Additional Inherited Members

- Public Attributes inherited from Script
std::string m_name
 Name of the script, useful for identification or debugging. More...
 
GameObjectm_owner
 Pointer to the GameObject that owns this script. More...
 

Detailed Description

Script to manage enemy artificial intelligence.

Inherits from the Script class to define specific behaviors for enemy characters, like movement speed and decision-making processes.

Definition at line 18 of file enemy_ai_script.h.

Constructor & Destructor Documentation

◆ EnemyAIScript()

EnemyAIScript::EnemyAIScript ( )

Constructs a new Enemy AI Script object.

Sets the initial speed of the enemy AI.

Definition at line 12 of file enemy_ai_script.cpp.

Member Function Documentation

◆ render()

void EnemyAIScript::render ( )
overridevirtual

Renders the enemy AI behavior.

This method is called once per frame after the update method, and should include any rendering logic specific to the enemy AI.

Reimplemented from Script.

Definition at line 66 of file enemy_ai_script.cpp.

◆ update()

void EnemyAIScript::update ( )
overridevirtual

Updates the behavior of the enemy each frame.

This method is called once per frame and should include logic to determine the enemy's actions based on its surroundings and internal state.

Reimplemented from Script.

Definition at line 17 of file enemy_ai_script.cpp.

Member Data Documentation

◆ m_speed

float EnemyAIScript::m_speed = 2
private

Speed of the enemy, controls how fast it moves

Definition at line 20 of file enemy_ai_script.h.


The documentation for this class was generated from the following files: