Bugfixes, added sound to portal and enemy in JSON

This commit is contained in:
2016-06-21 13:51:16 +02:00
parent 7c4805d899
commit 8700aa90af
18 changed files with 98 additions and 22 deletions
+5 -2
View File
@@ -5,8 +5,9 @@
#include <iostream>
Enemy::Enemy(const std::string &fileName,
const std::string &fileMusic,
const Vec3f &position,
Vec3f &rotation,
const Vec3f &rotation,
const float &scale)
{
model = Model::load(fileName);
@@ -18,7 +19,7 @@ Enemy::Enemy(const std::string &fileName,
speed = 1;
radius = 10;
hasTarget = false;
hit_sound_id = CrystalPoint::GetSoundSystem().LoadSound("WAVE/enemy.wav", false);
hit_sound_id = CrystalPoint::GetSoundSystem().LoadSound(fileMusic.c_str(), false);
music = CrystalPoint::GetSoundSystem().GetSound(hit_sound_id);
attack = false;
}
@@ -28,6 +29,8 @@ Enemy::~Enemy()
{
if (model)
Model::unload(model);
delete music;
}
void Enemy::draw()