Subversion Repositories QTron

Compare Revisions

Ignore whitespace Rev 40 → Rev 41

/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,6 → 196,8
// 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)
276,9 → 278,10
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,11 → 110,14
}
}
 
for (int i = 0; i < bikes.count(); i++)
if(ready)
{
if (bikes[i]->show)
for (int i = 0; i < bikes.count(); i++)
{
bikes[i]->draw(&painter,bikes);
if (bikes[i]->show)
{
bikes[i]->draw(&painter,bikes);
}
}
}