barre de vie

This commit is contained in:
Jonathan Trottier
2023-10-23 15:43:55 -04:00
parent 54c25e6f78
commit b943a268ae
4 changed files with 34 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
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; //TODO: Remettre <20> 1.0f
m_hp = 1.0f; //TODO: Remettre <20> 1.0f
m_username = "Zelda Bee-Bop56";
}
@@ -206,3 +206,19 @@ void Player::Teleport(int& x, int& z) {
m_position.x -= x * CHUNK_SIZE_X;
m_position.z -= z * CHUNK_SIZE_Z;
}
void Player::InflictDamage(Player playerHit, float hitPoints)
{
playerHit.m_hp -= hitPoints;
if (playerHit.GetHP() <= 0)
{ // Quand l'autre joueur est mort.
}
}