import pygame
import sys
FPS = 60
WIDTH = 800
HEIGHT = 600
WHITE = (255, 255, 255)
ORANGE = (255, 150, 100)
clock = pygame.time.Clock()
sc = pygame.display.set_mode((WIDTH,HEIGHT))
pygame.font.init()
f1 = pygame.font.Font(None, 36)
text1 = f1.render('Для увеличения нажмите a', True, (0, 180, 0))
text2 = f1.render('Для уменьшения нажмите z', True, (0, 180, 0))
x = WIDTH/2
y = HEIGHT/2
state = 10
r = 25
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_a:
r += 5
if event.key == pygame.K_z:
r -= 5
sc.fill(WHITE)
sc.blit(text1, (10, 50))
sc.blit(text2, (400, 50))
pygame.draw.circle(sc, ORANGE, (x, y),r)
pygame.display.update()
clock.tick(FPS)
|