#include <tb_entity_behavior_interface.h>
Public Member Functions | |
MoveToBehavior (Entity &entity, const tbMath::Vector2 &desiredPosition, float constantMoveSpeed) | |
virtual | ~MoveToBehavior (void) |
virtual void | OnSimulate (void) |
![]() | |
EntityBehaviorInterface (Entity &entity) | |
virtual | ~EntityBehaviorInterface (void)=0 |
Additional Inherited Members | |
![]() | |
virtual void | OnAdded (void) |
virtual void | OnRemoved (void) |
virtual void | OnPaused (void) |
virtual void | OnResume (void) |
virtual void | OnUpdate (const float deltaTime) |
virtual void | OnRender (void) const |
virtual void | OnCollideWith (const Entity &other) |
![]() | |
Entity & | mEntity |
The MoveToBehavior will move an Entity at a constant rate of speed towards a desiredPosition until they reach that location. The speed will not increase or decrease.
|
inline |
Creates a MoveToBehavior for the entity to move to a desired location, moving at the given speed.
entity | The entity that will be controlled by the behavior and moved. |
desiredPosition | The location the entity will travel toward, directly. |
constantMoveSpeed | The speed at which the entity will move at during the behavior, without speeding up or slowing down. |
|
inlinevirtual |
Cleans up after the MoveToBehavior, which doesn't involve a whole lot.
|
virtual |
Moves the entity toward the desired position by the constant speed, if the entity would have passed on by the desired position it stops at the desired position and this behavior will get popped off the entity.
Reimplemented from TurtleBrains::Game::EntityBehaviorInterface.