2022-08-26 19:27:57 -04:00
|
|
|
#ifndef ALAI_PLAYER_STATES_PLAYER_MOVE_H
|
|
|
|
#define ALAI_PLAYER_STATES_PLAYER_MOVE_H
|
2022-04-11 13:30:51 -04:00
|
|
|
|
|
|
|
#include "state_machine/State.h"
|
|
|
|
|
2022-10-10 21:54:12 -03:00
|
|
|
#include <AnimatedSprite.hpp>
|
2022-04-11 13:30:51 -04:00
|
|
|
#include <Godot.hpp>
|
|
|
|
#include <Input.hpp>
|
|
|
|
|
2022-08-26 19:27:57 -04:00
|
|
|
namespace alai
|
2022-04-11 13:30:51 -04:00
|
|
|
{
|
|
|
|
namespace player
|
|
|
|
{
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
2022-04-22 21:56:22 -04:00
|
|
|
* @brief This class controls what happens when the Player is in the move state.
|
2022-04-13 00:59:23 -04:00
|
|
|
*
|
|
|
|
*/
|
2022-04-11 13:30:51 -04:00
|
|
|
class PlayerMove : public State
|
|
|
|
{
|
2022-10-10 21:54:12 -03:00
|
|
|
GODOT_CLASS(PlayerMove, State)
|
2022-04-11 13:30:51 -04:00
|
|
|
|
|
|
|
private:
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
|
|
|
* @brief Input singleton.
|
|
|
|
*
|
|
|
|
*/
|
2022-08-26 19:27:57 -04:00
|
|
|
godot::Input *_input;
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
2022-04-22 21:56:22 -04:00
|
|
|
* @brief The animated sprite of the Player.
|
2022-04-13 00:59:23 -04:00
|
|
|
*
|
|
|
|
*/
|
2022-08-26 19:27:57 -04:00
|
|
|
godot::AnimatedSprite *animated_sprite;
|
2022-04-11 13:30:51 -04:00
|
|
|
|
|
|
|
public:
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
|
|
|
* @brief This method registers classes with Godot.
|
|
|
|
*
|
|
|
|
* @details This method registers methods, properties, and signals with the Godot engine.
|
|
|
|
*/
|
2022-04-11 13:30:51 -04:00
|
|
|
static void _register_methods();
|
|
|
|
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
2022-04-22 21:56:22 -04:00
|
|
|
* @brief Construct a new PlayerMove object.
|
2022-04-13 00:59:23 -04:00
|
|
|
*
|
|
|
|
*/
|
2022-04-11 13:30:51 -04:00
|
|
|
PlayerMove();
|
|
|
|
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
2022-04-22 21:56:22 -04:00
|
|
|
* @brief Destroy the PlayerMove object.
|
2022-04-13 00:59:23 -04:00
|
|
|
*
|
|
|
|
*/
|
2022-04-11 13:30:51 -04:00
|
|
|
~PlayerMove();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize the class from Godot.
|
2022-04-13 00:59:23 -04:00
|
|
|
*
|
2022-04-11 13:30:51 -04:00
|
|
|
* @details This method is called just once when the Godot engine connects to the instance of the class.
|
|
|
|
*/
|
|
|
|
void _init();
|
|
|
|
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
|
|
|
* @brief Called when the player enters the move state.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void _state_enter();
|
2022-04-11 13:30:51 -04:00
|
|
|
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
|
|
|
* @brief Called when the player exists the move state.
|
|
|
|
*
|
|
|
|
*/
|
2022-04-11 13:30:51 -04:00
|
|
|
void _state_exit();
|
|
|
|
|
2022-04-13 00:59:23 -04:00
|
|
|
/**
|
|
|
|
* @brief The physics processed every delta time.
|
|
|
|
*
|
|
|
|
* @param[in] delta The time since the method was last run.
|
|
|
|
*/
|
2022-04-11 13:30:51 -04:00
|
|
|
void _physics_process(float delta);
|
|
|
|
};
|
2022-10-10 21:54:12 -03:00
|
|
|
} // namespace player
|
|
|
|
} // namespace alai
|
2022-04-11 13:30:51 -04:00
|
|
|
|
|
|
|
#endif
|