correct core module with new types

This commit is contained in:
2010-08-23 14:40:52 +03:00
parent 191e5ed1a1
commit 9c8f9fb98c
15 changed files with 146 additions and 103 deletions

View File

@@ -1,12 +1,11 @@
#include "aliens.h"
#include <cmath>
Aliens::Aliens(Game_Data *gd, QObject *parent) :
QObject(parent)
{
gameData = gd;
nextId = 0;
nextId = 1;
}
@@ -63,7 +62,6 @@ void Aliens::update()
//qDebug() << i;
//if (al.health < 0) emit AlienKill();
float tmpdx,tmpdy,angl,arctg = 0;
qDebug() <<"alien"<< i << " path index" << al.pathIndex << " pos" << al.pos;
tmpdx = al.pos.x() - al.path.at(al.pathIndex).x();
tmpdy = al.pos.y() - al.path.at(al.pathIndex).y();
while (std::sqrt(tmpdx*tmpdx +tmpdy*tmpdy) < 2*al.speed)
@@ -104,6 +102,7 @@ void Aliens::update()
-al.speed*std::cos(arctg));
//return true;
gameData->curAliens.insert(al.Id,al);
qDebug() <<"alien"<< i << " path index" << al.pathIndex << " pos" << al.pos;
}
for (int j=0; j<missIndex.size(); j++)
{