Added health+damage to enemy

This commit is contained in:
2016-06-21 16:58:39 +02:00
parent 0a0fdfc8b1
commit ec900f7410
6 changed files with 63 additions and 3 deletions
+7 -1
View File
@@ -6,6 +6,8 @@
Enemy::Enemy(const std::string &fileName,
const std::string &fileMusic,
float damage,
float health,
const Vec3f &position,
const Vec3f &rotation,
const float &scale)
@@ -18,7 +20,11 @@ Enemy::Enemy(const std::string &fileName,
target = position;
speed = 1;
radius = 10;
xp = 10;
xp = health;
this->health = health;
this->damage = damage;
hasTarget = false;
hit_sound_id = CrystalPoint::GetSoundSystem().LoadSound(fileMusic.c_str(), false);
music = CrystalPoint::GetSoundSystem().GetSound(hit_sound_id);