feat: exposed health status getter on player
This commit is contained in:
parent
74aead946c
commit
a734eb8b20
2 changed files with 23 additions and 17 deletions
|
|
@ -3,15 +3,14 @@
|
|||
|
||||
#include "scene/3d/physics/character_body_3d.h"
|
||||
class WeaponInventory;
|
||||
class HealthStatus;
|
||||
|
||||
class PlayerBody : public CharacterBody3D {
|
||||
GDCLASS(PlayerBody, CharacterBody3D);
|
||||
static void _bind_methods();
|
||||
static PlayerBody *singleton_instance;
|
||||
|
||||
private:
|
||||
void ready();
|
||||
void process(double delta);
|
||||
void on_child_entered(Node *node);
|
||||
void physics_process(double delta);
|
||||
|
||||
void set_movement_input(Vector2 state);
|
||||
|
|
@ -26,6 +25,7 @@ public:
|
|||
static PlayerBody *get_singleton();
|
||||
bool get_is_running() const;
|
||||
bool get_wants_to_run() const;
|
||||
HealthStatus *get_health() const;
|
||||
|
||||
private:
|
||||
bool try_running{ false };
|
||||
|
|
@ -36,6 +36,7 @@ private:
|
|||
Vector2 movement_input{};
|
||||
|
||||
WeaponInventory *weapons;
|
||||
HealthStatus *health{ nullptr };
|
||||
};
|
||||
|
||||
#endif // !PLAYER_BODY_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue