rect_x = 50pygame.draw.rect(screen, WHITE, [rect_x, 50, 50, 50])rect_x += 1 |
if rect_y > 450 or rect_y < 0: rect_y = rect_y * -1 |
for i in range(50): x = random.randrange(0, 400) y = random.randrange(0, 400) pygame.draw.circle(screen, WHITE, [x, y], 2) |
stars = [[ 3, 4], [33, 94], [ 0, 0]] |
# Process each snow flake in the listfor i in range(len(snow_list)): # Get the x and y from the list x = snow_list[i][0] y = snow_list[i][1] # Draw the snow flake pygame.draw.circle(screen, WHITE, [x, y], 2) # Move the snow flake down one pixel snow_list[i][1] += 1 |
So does the example below. Explain why this example works as well.
# Process each snow flake in the listfor i in range(len(snow_list)): # Draw the snow flake pygame.draw.circle(screen, WHITE, snow_list[i], 2) # Move the snow flake down one pixel snow_list[i][1] += 1 |