Я хотел создать приложение pygame, которое будет делать каждый пиксель на экране 500,500 случайным цветом, но при этом окрашивает только верхнюю строку.
here is the code:
import pygame,sys, random, time
y = 0
x = 0
true = True
pygame.init()
screen = pygame.display.set_mode((500,500))
screen.fill((255,255,255))
while true:
r = random.randint(0,255)
g = random.randint(0,255)
b = random.randint(0,255)
print x
pygame.draw.line(screen, (r,g,b),(x,y),(x,y))
if x >= 500:
x == 0
y += 1
x += 1
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit(); sys.exit();