degats dans bullet

This commit is contained in:
Jonathan Trottier
2023-10-30 14:36:44 -04:00
parent ada9330588
commit 6e75bec25c
5 changed files with 42 additions and 11 deletions

View File

@@ -206,15 +206,20 @@ void Player::Teleport(int& x, int& z) {
m_position.x -= x * CHUNK_SIZE_X;
m_position.z -= z * CHUNK_SIZE_Z;
}
bool Player::AmIDead()
{
return m_hp <= 0;
}
void Player::InflictDamage(Player playerHit, float hitPoints)
void Player::InflictDamage(float hitPoints)
{
playerHit.m_hp -= hitPoints;
m_hp -= hitPoints;
if (playerHit.GetHP() <= 0)
{ // Quand l'autre joueur est mort.
if (AmIDead())
{ // Quand le joueur est mort.