grafika_komputerowa/grk/project/GameEntity.h

32 lines
649 B
C
Raw Permalink Normal View History

2024-02-03 20:20:01 +01:00
#include "glm.hpp"
#pragma once
class GameEntity
{
public:
float currentHP;
float dmg;
float maxHP;
float initDMG;
2024-02-03 20:20:01 +01:00
GameEntity(float currentHP, float maxHP, float initialDmg)
: currentHP(currentHP), maxHP(maxHP), dmg(initialDmg),initDMG(initialDmg)
2024-02-03 20:20:01 +01:00
{
}
virtual void applyDamage(float attackerDmg) {
currentHP = currentHP - attackerDmg;
};
virtual glm::vec3 getPosition() const = 0;
virtual glm::mat4 getModelMatrix() = 0;
2024-02-07 23:44:53 +01:00
virtual bool isAlive() {
if (this->currentHP <= 0) {
return false;
}
return true;
};
virtual void respawn() = 0;
2024-02-03 20:20:01 +01:00
};