Control the input from users and update player's information. More...
#include <PlayerController.h>
Public Member Functions | |
PlayerController ()=default | |
Constructor. More... | |
~PlayerController ()=default | |
Destructor. More... | |
float | getSpeedX () |
Return player's speed on horizontal direction. More... | |
float | getSpeedY () |
Return player's speed on vertical direction. More... | |
void | applyGravity () |
Apply gravity on player. More... | |
void | playerIsOnGround (bool status) |
Check whether player on the ground. More... | |
PLAYER_STATE | getState () |
Return the player's state. More... | |
PLAYER_DIR | getDir () |
Return the player's current orientation. More... | |
void | processInput (std::vector< bool > &keyPressed, int &x, int &y) |
bool | shouldReset () |
Public Member Functions inherited from Component | |
Component () | |
~Component () | |
Control the input from users and update player's information.
|
default |
Constructor.
|
default |
Destructor.
void PlayerController::applyGravity | ( | ) |
Apply gravity on player.
PLAYER_DIR PlayerController::getDir | ( | ) |
Return the player's current orientation.
float PlayerController::getSpeedX | ( | ) |
Return player's speed on horizontal direction.
float PlayerController::getSpeedY | ( | ) |
Return player's speed on vertical direction.
PLAYER_STATE PlayerController::getState | ( | ) |
Return the player's state.
void PlayerController::playerIsOnGround | ( | bool | status | ) |
Check whether player on the ground.
status | The current onground state. |
void PlayerController::processInput | ( | std::vector< bool > & | keyPressed, |
int & | x, | ||
int & | y | ||
) |
Process user input.
keyPressed | The information of pressed keys. |
x | |
y |
bool PlayerController::shouldReset | ( | ) |