Advertisement
Guest User

Old_main

a guest
Jan 25th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.10 KB | None | 0 0
  1. import time
  2.  
  3. import pygame
  4.  
  5. d = True
  6. a = ""
  7. v = [1, 2, 3]
  8.  
  9.  
  10. def main():
  11.     while d:
  12.         y = 0
  13.         y1 = 0
  14.         y2 = 0
  15.         y3 = 0
  16.         y4 = 0
  17.         y5 = 0
  18.         wei = 15
  19.         speed = 5
  20.         sume = 0
  21.         avalible = False
  22.         avalible1 = False
  23.         avalible2 = False
  24.         avalible3 = False
  25.         avalible4 = False
  26.         invisible = True
  27.         invisible1 = True
  28.         invisible2 = True
  29.         invisible3 = True
  30.         invisible4 = True
  31.         blue = False
  32.         green = False
  33.         red = False
  34.         yellow = False
  35.  
  36.         a = True
  37.         pygame.init()
  38.         x1 = pygame.display.set_mode((640, 512))
  39.  
  40.         pygame.display.set_caption("KekRythm")
  41.  
  42.         run = True
  43.         a1 = 0
  44.         while run:
  45.             pygame.time.delay(50)
  46.  
  47.             for event in pygame.event.get():
  48.                 if event.type == pygame.QUIT:
  49.                     run = False
  50.                     exit()
  51.             keys = pygame.key.get_pressed()
  52.  
  53.             x1.fill((0, 0, 0))
  54.             pygame.draw.line(x1, (255, 255, 255), (0, 455), (640, 455), 1)
  55.             pygame.draw.line(x1, (0, 0, 255), (128, 0), (128, 512), 1)
  56.             pygame.draw.line(x1, (0, 255, 0), (256, 0), (256, 512), 1)
  57.             pygame.draw.line(x1, (255, 0, 0), (384, 0), (384, 512), 1)
  58.             pygame.draw.line(x1, (255, 255, 0), (512, 0), (512, 512), 1)
  59.             pygame.draw.circle(x1, (255, 255, 255), (128, 455), 17)
  60.             pygame.draw.circle(x1, (0, 0, 0), (128, 455), 15)
  61.             pygame.draw.circle(x1, (255, 255, 255), (256, 455), 17)
  62.             pygame.draw.circle(x1, (0, 0, 0), (256, 455), 15)
  63.             pygame.draw.circle(x1, (255, 255, 255), (384, 455), 17)
  64.             pygame.draw.circle(x1, (0, 0, 0), (384, 455), 15)
  65.             pygame.draw.circle(x1, (255, 255, 255), (512, 455), 17)
  66.             pygame.draw.circle(x1, (0, 0, 0), (512, 455), 15)
  67.  
  68.             if y1 > 530:
  69.                 invisible1 = False
  70.                 y1 = 0
  71.                 invisible1 = True
  72.             if invisible1 and blue:
  73.                 pygame.draw.circle(x1, (0, 0, 255), (128, y1), (wei))
  74.  
  75.             if y2 > 530:
  76.                 invisible2 = False
  77.                 y2 = 0
  78.                 invisible2 = True
  79.             if invisible2 and green:
  80.                 pygame.draw.circle(x1, (0, 255, 0), (256, y2), (wei))
  81.  
  82.             if y3 > 530:
  83.                 invisible3 = False
  84.                 y3 = 0
  85.                 invisible3 = True
  86.             if invisible3 and red:
  87.                 pygame.draw.circle(x1, (255, 0, 0), (384, y3), (wei))
  88.  
  89.             if y4 > 530:
  90.                 invisible4 = False
  91.                 y4 = 0
  92.                 invisible4 = True
  93.             if invisible4 and yellow:
  94.                 pygame.draw.circle(x1, (255, 255, 0), (512, y4), (wei))
  95.  
  96.             sum1 = str(sume)
  97.             c1 = pygame.font.Font(None, 36)
  98.             text1 = c1.render(sum1, 1, (180, 0, 0))
  99.  
  100.             x1.blit(text1, (10, 50))
  101.  
  102.             #  if avalible == False:
  103.             #    if keys[pygame.K_q] or keys[pygame.K_w] or keys[pygame.K_e] or keys[pygame.K_r]:
  104.             #        sume -= 1
  105.  
  106.             if avalible1 == False:
  107.                 if keys[pygame.K_q]:
  108.                     sume -= 1
  109.  
  110.             if avalible2 == False:
  111.                 if keys[pygame.K_w]:
  112.                     sume -= 1
  113.  
  114.             if avalible3 == False:
  115.                 if keys[pygame.K_e]:
  116.                     sume -= 1
  117.  
  118.             if avalible4 == False:
  119.                 if keys[pygame.K_r]:
  120.                     sume -= 1
  121.  
  122.             if y1 >= 430:
  123.                 if y1 <= 480:
  124.                     avalible1 = True
  125.                     if keys[pygame.K_q]:
  126.                         # invisible1 = False
  127.                         sume += 1
  128.                         y1 = 0
  129.                         invisible1 = False
  130.                         blue = False
  131.  
  132.             if y1 < 430 or y1 > 480:
  133.                 avalible1 = False
  134.  
  135.             if y2 >= 430:
  136.                 if y2 <= 480:
  137.                     avalible2 = True
  138.                     if keys[pygame.K_w]:
  139.                         # invisible2 = False
  140.                         sume += 1
  141.                         y2 = 0
  142.                         invisible2 = False
  143.                         green = False
  144.  
  145.             if y2 < 430 or y2 > 480:
  146.                 avalible2 = False
  147.  
  148.             if y3 >= 430:
  149.                 if y3 <= 480:
  150.                     avalible3 = True
  151.                     if keys[pygame.K_e]:
  152.                         sume += 1
  153.                         # invisible3 = False
  154.                         y3 = 0
  155.                         invisible3 = False
  156.                         red = False
  157.  
  158.             if y3 < 430 or y3 > 480:
  159.                 avalible3 = False
  160.  
  161.             if y4 >= 430:
  162.                 if y4 <= 480:
  163.                     avalible4 = True
  164.                     if keys[pygame.K_r]:
  165.                         sume += 1
  166.                         # invisible4 = False
  167.                         y4 = 0
  168.                         invisible4 = False
  169.                         yellow = False
  170.             if y4 < 430 or y4 > 480:
  171.                 avalible4 = False
  172.  
  173.             pygame.display.flip()
  174.  
  175.             if d and invisible1 == True:
  176.                 y1 += speed
  177.             if d and invisible2 == True:
  178.                 y2 += speed
  179.             if d and invisible3 == True:
  180.                 y3 += speed
  181.             if d and invisible4 == True:
  182.                 y4 += speed
  183.  
  184.             while len(v) != 0:
  185.                 mute = v.pop(0)
  186.                 if mute == 1:
  187.                     blue = True
  188.                     invisible1 = True
  189.                 elif mute == 2:
  190.                     green = True
  191.                     invisible2 = True
  192.                 elif mute == 3:
  193.                     red = True
  194.                     invisible3 = True
  195.                 elif mute == 4:
  196.                     yellow = True
  197.                     invisible4 = True
  198.                 elif mute == "_":
  199.                     time.sleep(1)
  200.  
  201.     return 0
  202.  
  203.  
  204. if __name__ == "__main__":
  205.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement