More Generalized

This commit is contained in:
Aaldert
2016-06-05 15:26:14 +02:00
parent f0a8330819
commit 0afbca8ffc
4 changed files with 25 additions and 10 deletions
+5 -2
View File
@@ -5,7 +5,6 @@
#include "Model.h"
#include <iostream>
Enemy::Enemy(const std::string &fileName,
const Vec3f &position,
Vec3f &rotation,
@@ -21,6 +20,7 @@ Enemy::Enemy(const std::string &fileName,
speed = 1;
radius = 10;
hasTarget = false;
openal = new OpenAL();
}
@@ -51,9 +51,12 @@ void Enemy::draw()
void Enemy::update(float delta)
{
if (!openal->isMusicPlaying()) {
openal->playMusic();
}
if (hasTarget)
{
OpenAL();
//just 2d walking
float dx, dz, length;