global restruct finish 2 of 3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user