2025-01-08 15:42:38 +00:00
|
|
|
#ifndef PLAYER_HPP
|
|
|
|
#define PLAYER_HPP
|
|
|
|
|
|
|
|
#include "core/collidable_node.hpp"
|
2025-01-09 20:57:21 +00:00
|
|
|
#include "core/input/input_value.hpp"
|
2025-01-08 15:42:38 +00:00
|
|
|
|
|
|
|
namespace ce {
|
|
|
|
class CollisionShape;
|
|
|
|
class Sprite;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Player : public ce::CollidableNode {
|
2025-01-09 20:57:21 +00:00
|
|
|
ce::Vecf const SPEED{3.f, 2.5f};
|
|
|
|
float const ACCELERATION{20.f};
|
|
|
|
|
|
|
|
ce::Vecf velocity{0.f, 0.f};
|
|
|
|
ce::Vecf input{0.f, 0.f};
|
2025-01-08 15:42:38 +00:00
|
|
|
ce::CollisionShape *shape{nullptr};
|
|
|
|
ce::Sprite *sprite{nullptr};
|
|
|
|
public:
|
|
|
|
Player();
|
|
|
|
virtual void _tick(double const &delta) override;
|
2025-01-09 20:57:21 +00:00
|
|
|
void _input_horizontal_movement(ce::InputValue value);
|
|
|
|
void _input_vertical_movement(ce::InputValue value);
|
|
|
|
void _on_overlap_enter(ce::CollisionShape *, ce::CollidableNode *node, ce::CollisionShape*);
|
2025-01-08 15:42:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // !PLAYER_HPP
|