Subversion Repositories QTron

Compare Revisions

Ignore whitespace Rev 41 → Rev 40

/bike.cpp
12,7 → 12,7
 
x = rand() % 80000;
y = rand() % 60000;
//linePoints.append(QPoint(x, y));
linePoints.append(QPoint(x, y));
 
velocity = 100;
angle = (rand() % 4) * 90;
196,8 → 196,6
// Do collision detection here
// use linePoints
int i = linePoints.count() - 1;
if(i <= 0)
return false;
if(linePoints[i-1].x() < 0 || linePoints[i-1].x() >= 80000 || linePoints[i-1].y() < 0 || linePoints[i-1].y() >= 60000)
return true;
if(linePoints[i].x() < 0 || linePoints[i].x() >= 80000 || linePoints[i].y() < 0 || linePoints[i].y() >= 60000)
278,10 → 276,9
cout << "Reset was called\n";
x = rand() % 80000;
y = rand() % 60000;
cout << "x: " << x << " y: " << y << endl;
linePoints.clear();
 
//linePoints.append(QPoint(x, y));
linePoints.append(QPoint(x, y));
 
velocity = 100;
angle = 0;
/mainwindow.cpp
110,14 → 110,11
}
}
 
if(ready)
for (int i = 0; i < bikes.count(); i++)
{
for (int i = 0; i < bikes.count(); i++)
if (bikes[i]->show)
{
if (bikes[i]->show)
{
bikes[i]->draw(&painter,bikes);
}
bikes[i]->draw(&painter,bikes);
}
}