|
Turbo Engine 0.3
A C++ game engine using Allegro 5
|
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. | |
| Component (GameObject *parent) | |
| Construct a new Component. The component will be automatically added to the GameObject given as parameter. | |
| Public Member Functions inherited from turbo::Component | |
| Component (GameObject *parent) | |
| Construct a new Component. The component will be automatically added to the GameObject given as parameter. | |
| 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. | |
| const char * | get_name () const |
| Display name of the component (used by the editor). | |
Public Attributes | |
| float | acceleration = 1.0 |
| float | max_speed = 15 |
| float | friction = 0.1 |
| Public Attributes inherited from turbo::Component | |
| ::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>() |
| Protected Attributes inherited from turbo::Component | |
| GameObject * | gameObject = nullptr |
| bool | enabled = true |
| const char * | name = "Unknown" |
Simple pre-made component used handle an 8-direction movement with the arrow keys.
|
explicit |
Construct a new Component. The component will be automatically added to the GameObject given as parameter.
| parent | GameObject that holds the component |
|
overridevirtual |
Called when the component is loaded into the scene.
Reimplemented from turbo::Component.
|
overridevirtual |
Called when the component is disabled.
Reimplemented from turbo::Component.
|
overridevirtual |
Called when the component is enabled (Not called on the first initialization).
Reimplemented from turbo::Component.
|
overridevirtual |
Called when the component is unloaded.
Reimplemented from turbo::Component.
|
overridevirtual |
Logic update. Souldn't be used for anything else than logic.
| delta_time | milliseconds since the last call |
Reimplemented from turbo::Component.
| float turbo::component::SimpleControl::acceleration = 1.0 |
| float turbo::component::SimpleControl::friction = 0.1 |
| float turbo::component::SimpleControl::max_speed = 15 |
|
protected |