import pygame
import random
pygame.init()
win = pygame.display.set_mode((500,500))
pygame.display.set_caption("")
x = 250
y = 100
size = 0
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
size = size + 5
win.fill((0,0,0))
pygame.draw.rect(win, (255, 255, 255), (x, y+10-size, 50,50))
pygame.draw.rect(win, (255, 255, 255), (x-50-size, y+60+size, 50,50))
pygame.draw.rect(win, (255, 255, 255), (x+50+size, y+60+size, 50,50))
pygame.draw.rect(win, (255, 255, 255), (x-100-size, y+110+size, 50,50))
pygame.draw.rect(win, (255, 255, 255), (x+100+size, y+110+size, 50,50))
pygame.draw.rect(win, (255, 255, 255), (x-50-size, y+160+size, 50,50))
pygame.draw.rect(win, (255, 255, 255), (x+50+size, y+160+size, 50,50))
pygame.draw.rect(win, (255, 255, 255), (x, y+210+size, 50,50))
pygame.display.update()
pygame.quit()
|