13,7 → 13,6 |
x = rand() % 800; |
y = rand() % 600; |
linePoints.append(QPoint(x, y)); |
linePoints.append(QPoint(x, y)); |
|
velocity = 1; |
angle = 0; |
117,6 → 116,8 |
} |
} |
|
linePoints.append(QPoint(x, y)); |
|
if (dead) |
{ |
show = false; |
142,7 → 143,7 |
dead = true; |
} |
} |
hasHadGo = true; |
hasHadGo = true; |
} |
|
void Bike::reset() |
152,7 → 153,6 |
linePoints.clear(); |
|
linePoints.append(QPoint(x, y)); |
linePoints.append(QPoint(x, y)); |
|
velocity = 1; |
angle = 0; |
173,7 → 173,6 |
|
if (line == "L") |
{ |
linePoints.append(QPoint(x, y)); |
angle -= 90; |
|
if (angle >= 360) |
188,7 → 187,6 |
} |
else if (line == "R") |
{ |
linePoints.append(QPoint(x, y)); |
angle += 90; |
|
if (angle >= 360) |
203,19 → 201,16 |
} |
else if (line == "A") |
{ |
linePoints[linePoints.size() - 1] = QPoint(x, y); |
velocity += 0.1; |
hadGo = true; |
} |
else if (line == "D") |
{ |
linePoints[linePoints.size() - 1] = QPoint(x, y); |
velocity -= 0.2; |
hadGo = true; |
} |
else if (line == "N") |
{ |
linePoints[linePoints.size() - 1] = QPoint(x, y); |
hadGo = true; |
} |
else if (line.startsWith("NAME ")) |