global restruct finish 2 of 3

This commit is contained in:
2010-02-07 19:22:29 +03:00
parent 86f5e2f625
commit 105c340243
20 changed files with 1103 additions and 249 deletions

View File

@@ -73,7 +73,7 @@ bool Alien::RecreatePath()
}
void Alien::update()
bool Alien::update()
{
float tmpdx,tmpdy,angl,arctg = 0;
tmpdx = position.x() - path.at(PathIndex).x()*game->cellsize;
@@ -81,11 +81,11 @@ void Alien::update()
while (std::sqrt(tmpdx*tmpdx +tmpdy*tmpdy) < 2*Speed*game->cellsize)
{
PathIndex++;
if (PathIndex >= path.size())
{
if (PathIndex >= path.size()) return false;
/*{
PathIndex = 0;
position = game->start*game->cellsize;
}
}*/
tmpdx = position.x() - path.at(PathIndex).x()*game->cellsize;
tmpdy = position.y() - path.at(PathIndex).y()*game->cellsize;
//qDebug() << "next";
@@ -109,6 +109,7 @@ void Alien::update()
position.setY(position.y()
-Speed*(float)game->cellsize*std::cos(arctg));
PicIndex++;
return true;
}