#!/bin/python
import pygame, sys
import random
import math
green = (0, 255, 0)
blue = (0, 0, 128)
red = (255, 0, 0)
pygame.init()
sc = pygame.display.set_mode((500, 500))
pygame.display.set_caption("Чокнутый секундомер")
pygame.time.set_timer(pygame.USEREVENT, 1000)
sc.fill((125,125,125))
counter = 0
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if event.type == pygame.USEREVENT:
sc.fill((125,125,125))
font = pygame.font.SysFont('Arial', random.randint(50,100))
sc.blit(font.render(str(counter), True, (255, 255, 0)), (250, 150))
counter += 1
pygame.display.flip()
|