Push branche HUD. Propriétes et getters pour Player (HP, username). Changements minimes à Audio (enlever d'un merge). Modification et ajouts de DrawHud et DrawData

This commit is contained in:
Mathieu Duval
2023-09-15 11:24:43 -04:00
parent 8e40f17b75
commit f8ad857666
9 changed files with 216 additions and 133 deletions

View File

@@ -4,6 +4,8 @@
Player::Player(const Vector3f& position, float rotX, float rotY) : m_position(position), m_rotX(rotX), m_rotY(rotY) {
m_velocity = Vector3f(0, 0, 0);
m_airborne = true;
m_hp = 0.75f;
m_username = "John Doe";
}
void Player::TurnLeftRight(float value) {
@@ -183,6 +185,10 @@ Vector3f Player::GetPOV() const { return Vector3f(GetPosition().x, m_POV, GetPos
Vector3f Player::GetDirection() const { return m_direction; }
std::string Player::GetUsername() const { return m_username; }
float Player::GetHP() const { return m_hp; }
void Player::Teleport(int& x, int& z) {
m_position.x -= x * CHUNK_SIZE_X;
m_position.z -= z * CHUNK_SIZE_Z;