diff --git a/Enemy.cpp b/Enemy.cpp index e8bc92c..efe6147 100644 --- a/Enemy.cpp +++ b/Enemy.cpp @@ -83,7 +83,11 @@ void Enemy::collide(const Entity * entity) } void Enemy::hit(int damage){ + health -= damage; +} +bool Enemy::isDead(){ + return health < 0; } void Enemy::update(float delta) diff --git a/Enemy.h b/Enemy.h index 3ba5cb1..0be19e1 100644 --- a/Enemy.h +++ b/Enemy.h @@ -29,6 +29,7 @@ public: void inEyeSight(Vec3f &); void collide(const Entity *entity); void hit(int damage); + bool isDead(void); private: int hit_sound_id; };