barre de vie
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -26,6 +26,9 @@ public:
|
||||
float GetHP() const;
|
||||
void Teleport(int& x, int& z);
|
||||
|
||||
|
||||
void InflictDamage(Player playerHit, float hitPoints);
|
||||
|
||||
private:
|
||||
Vector3f m_position;
|
||||
Vector3f m_velocity;
|
||||
|
Reference in New Issue
Block a user