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