if not crash:
for i in range(lane_count):
pygame.draw.rect(screen, WHITE, [lanes[i][1], lane_width, lane_height])
lanes[i][1] += 10
if lanes[i][1] > WINDOW_HEIGHT:
lanes[i][1] = -40 = lane_height
An error appears in the -40 number part here
error
a = b = 10
The syntax is to assign 10 to the variable b
and a
to b
.
In the code you've given us as an example, we'll try to assign the value of lane_height
to -40
in -40=lane_height
. However, -40
is a fixed value (literal), not a variable, so it cannot be assigned. That's why the error occurs.
© 2024 OneMinuteCode. All rights reserved.