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; |
175,7 → 175,8 |
dead = true; |
} |
} |
hasHadGo = true; |
if(hadGo || dead) |
hasHadGo = true; |
|
time_t result = time(NULL); |
cout << result << ": Recieved next move from " << name.toStdString().c_str() << endl; |
196,6 → 197,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 → 279,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; |