Translates keyboard input (WASD) into entity movement. More...
#include <Controller.h>


Public Member Functions | |
| void | init () override |
| Initializes the controller, grabbing the entity's Transform and Collider. | |
| void | updateKeyDown (SDL_Keycode key) |
| Updates the state when a key is pressed down. | |
| void | updateKeyUp (SDL_Keycode key) |
| Updates the state when a key is released. | |
| void | update () override |
| Calculates and applies velocity to the Transform based on current key states. | |
| void | reload () override |
| Resets the controller's state. | |
Public Member Functions inherited from Component | |
| virtual void | draw () |
| Called once per frame after update. Used for rendering. | |
Additional Inherited Members | |
Public Attributes inherited from Component | |
| Entity * | entity |
| Pointer to the entity that owns this component. | |
Translates keyboard input (WASD) into entity movement.
Reads keyboard state changes and updates the entity's Transform component's velocity.
|
overridevirtual |
|
overridevirtual |
Resets the controller's state.
Reimplemented from Component.

|
overridevirtual |
| void Controller::updateKeyDown | ( | SDL_Keycode | key | ) |
Updates the state when a key is pressed down.
| key | The SDL_Keycode of the pressed key. |

| void Controller::updateKeyUp | ( | SDL_Keycode | key | ) |
Updates the state when a key is released.
| key | The SDL_Keycode of the released key. |
