import
pygame
Eile
Import random
pygame. font. init()
FPS-30
WHITE- (255,255,255)
GREEN- (0,255,0)
BLUE-(0,0,255) # Создание окна
pygame. init ()
((900,500))
screen pygame.display.set_mode pygame.display.set caption ("My Game")
clock- pygame. time.Clock() scroon.fill (WHITE)
K-0
p-0 k1-0
p1-0 x-random.randint (50,850)
y-random.randint (100, 450)
font- pygame. font.
Font (None, 50)
# Игровой цик
run - True while run:
or event in pygame.event.get():
If event.type-pygame.QUIT: run Palsis
pygame.draw.circle (screen, GREEN, (x, y),20)1
event. tyре -pygame.MOUSEBUTTONDOWN:
11 ovent. button-1:
spot - event.ров
if x-20<-spot[0]<-x+20 and y-20<-spot[1]<-y+20:
k-k+1
p-p+1 pl-p*100//(k+p) elnot
p-p+1
pl-p 100//(k+p)) kl-k*100//(k+p)
x random. randint(50,850) y-random. randint(100, 450)
screen. fill (WHITE)
text - font.render ("Попаданий; "+ste (k1)+" 85, BLUE) text2font.render("Mooste (p1) + ",rue, BLUE)
screen blit(text,(100, 50)) screen.blit(text2, (100,100))
pygame.display.update()
pygame.quit()