turbo::component::SimpleControl Class Reference
Simple pre-made component used handle an 8-direction movement with the arrow keys. More...
#include <SimpleControl.hpp>


Public Member Functions | |
void | load () override |
Called when the component is loaded into the scene. | |
void | on_disable () override |
Called when the component is disabled. | |
void | on_enable () override |
Called when the component is enabled (Not called on the first initialization) | |
void | unload () override |
Called when the component is unloaded. | |
void | update (int delta_time) override |
Logic update. Souldn't be used for anything else than logic. More... | |
![]() | |
Component (GameObject *parent) | |
Construct a new Component. The component will be automatically added to the GameObject given as parameter. More... | |
void | disable () |
Disable the component. Do nothing if already disabled. | |
void | enable () |
Enable the component. Do nothing if already enabled. | |
bool | is_enabled () |
Check if the component is enabled. More... | |
const char * | get_name () const |
Public Attributes | |
float | acceleration = 1.0 |
float | max_speed = 15 |
float | friction = 0.1 |
![]() | |
::std::vector< debug::InspectorObserver * > | debug_inspector_observers {} |
Debug use only. List of observed values in the inspector. | |
Protected Attributes | |
::turbo::Vector2< float > | velocity = ::turbo::Vector2<float>() |
![]() | |
GameObject * | gameObject = nullptr |
bool | enabled = true |
const char * | name = "Unknown" |
Detailed Description
Simple pre-made component used handle an 8-direction movement with the arrow keys.
Member Function Documentation
◆ update()
|
overridevirtual |
Logic update. Souldn't be used for anything else than logic.
- Parameters
-
delta_time milliseconds since the last call
Reimplemented from turbo::Component.
The documentation for this class was generated from the following files:
- include/turbo/components/SimpleControl.hpp
- src/components/SimpleControl.cpp