import pygame
WHITE = (255, 255, 255)
RED = (225, 0, 50)
GREEN = (0, 225, 0)
BLUE = (0, 0, 225)
pygame.init()
sc = pygame.display.set_mode((400, 300))
sc.fill(WHITE)
pygame.display.update()
pygame.mouse.set_visible(False)
while 1:
for i in pygame.event.get():
if i.type == pygame.QUIT:
exit()
pressed = pygame.mouse.get_pressed()
pos = pygame.mouse.get_pos()
if pressed[0]:
sc.fill(WHITE)
pygame.display.update()
if pressed[1]:
sc.fill(RED)
pygame.display.update()
if pressed[2]:
sc.fill(GREEN)
pygame.display.update()
pygame.time.delay(20)
|