Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.07 KB | None | 0 0
  1. import pygame
  2. d = True
  3. a = ""
  4. sprites=("sprite.png","sprite.png","sprite.png","sprite.png")
  5. sprite_surf=[]
  6. x1 = pygame.display.set_mode((640, 512))
  7. for i in range(len(sprites)):
  8. sprite_surf.append(pygame.image.load(r"C:\Users\Comp\PycharmProjects\Kekrythm-GAMEHACKIIII-\1.png").convert_alpha())
  9. class note(pygame.sprite.Sprite):
  10. def __init__(self, x, surf, speed,group):
  11. pygame.sprite.Sprite.__init__(self)
  12. y=512
  13. self.image = surf
  14. self.speed = speed
  15. self.x=x
  16. self.y=512
  17. self.add(group)
  18. self.rect = self.image.get_rect(center=(x, y))
  19.  
  20.  
  21. def update(self):
  22. if self.rect.y > 0:
  23. self.rect.y -= self.speed
  24. else:
  25.  
  26. self.kill()
  27.  
  28. sprit = pygame.sprite.Group()
  29. blue_note= note(128,x1,5,sprit)
  30.  
  31. def main():
  32. while d:
  33. y = 0
  34.  
  35.  
  36. y1 = 0
  37. y2 = 0
  38. y3 = 0
  39. y4 = 0
  40. wei = 15
  41. speed = 5
  42. invisible1 = True
  43. invisible2 = True
  44. invisible3 = True
  45. invisible4 = True
  46.  
  47. a = True
  48. pygame.init()
  49. x1 = pygame.display.set_mode((640, 512))
  50.  
  51. pygame.display.set_caption("KekRythm")
  52.  
  53. run = True
  54. a1 = 0
  55.  
  56. while run:
  57. pygame.time.delay(50)
  58.  
  59. for event in pygame.event.get():
  60. if event.type == pygame.QUIT:
  61. run = False
  62. exit()
  63. keys = pygame.key.get_pressed()
  64.  
  65. x1.fill((0, 0, 0))
  66. pygame.draw.line(x1, (255, 255, 255), (0, 455), (640, 455), 1)
  67. pygame.draw.line(x1, (0, 0, 255), (128, 0), (128, 512), 1)
  68. pygame.draw.line(x1, (0, 255, 0), (256, 0), (256, 512), 1)
  69. pygame.draw.line(x1, (255, 0, 0), (384, 0), (384, 512), 1)
  70. pygame.draw.line(x1, (255, 255, 0), (512, 0), (512, 512), 1)
  71. pygame.draw.circle(x1, (255, 255, 255), (128, 455), 17)
  72. pygame.draw.circle(x1, (0, 0, 0), (128, 455), 15)
  73. pygame.draw.circle(x1, (255, 255, 255), (256, 455), 17)
  74. pygame.draw.circle(x1, (0, 0, 0), (256, 455), 15)
  75. pygame.draw.circle(x1, (255, 255, 255), (384, 455), 17)
  76. pygame.draw.circle(x1, (0, 0, 0), (384, 455), 15)
  77. pygame.draw.circle(x1, (255, 255, 255), (512, 455), 17)
  78. pygame.draw.circle(x1, (0, 0, 0), (512, 455), 15)
  79.  
  80. # if y > 510:
  81. # invisible = False
  82. # if invisible:
  83. # pygame.draw.circle(x1, (0, 0, 255), (128, y), (wei))
  84. # pygame.draw.circle(x1, (0, 255, 0), (256, y), (wei))
  85. # pygame.draw.circle(x1, (255, 0, 0), (384, y), (wei))
  86. # pygame.draw.circle(x1, (255, 255, 0), (512, y), (wei))
  87. blue_note= note(128,x1,speed,sprit)
  88. green_note=note(256,x1,speed,sprit)
  89. red_note=note(384,x1,speed,sprit)
  90. yell_note=note(512,x1,speed,sprit)
  91. if(blue_note.y>510):
  92. blue_note.kill()
  93. if (red_note.y > 510):
  94. red_note.kill()
  95. if (green_note.y > 510):
  96. green_note.kill()
  97. if (yell_note.y > 510):
  98. yell_note.kill()
  99.  
  100. # if y1 > 510:
  101. # invisible1 = False
  102. # if invisible1:
  103. # pygame.draw.circle(x1, (0, 0, 255), (128, y1), (wei))
  104. #
  105. # if y2 > 510:
  106. # invisible2 = False
  107. # if invisible2:
  108. # pygame.draw.circle(x1, (0, 0, 255), (128, y2), (wei))
  109. #
  110. # if y3 > 510:
  111. # invisible3 = False
  112. # if invisible3:
  113. # pygame.draw.circle(x1, (0, 0, 255), (128, y3), (wei))
  114. #
  115. # if y4 > 510:
  116. # invisible4 = False
  117. # if invisible4:
  118. # pygame.draw.circle(x1, (0, 0, 255), (128, y4), (wei))
  119.  
  120. if y1 >= 440:
  121. if y1 <= 470:
  122. if keys[pygame.K_q]:
  123. invisible1 = False
  124. y1 = 0
  125. invisible1 = True
  126.  
  127. if y2 >= 440:
  128. if y2 <= 470:
  129. if keys[pygame.K_w]:
  130. invisible2 = False
  131. y2 = 0
  132. invisible2 = True
  133.  
  134. if y3 >= 440:
  135. if y3 <= 470:
  136. if keys[pygame.K_e]:
  137. invisible3 = False
  138. y3 = 0
  139. invisible3 = True
  140.  
  141. if y4 >= 440:
  142. if y4 <= 470:
  143. if keys[pygame.K_r]:
  144. invisible4 = False
  145. y4 = 0
  146. invisible4 = True
  147. sprit.draw(x1)
  148. pygame.display.flip()
  149. sprit.update()
  150. pygame.time.delay(20)
  151.  
  152. if d:
  153. y1 += speed
  154. if d:
  155. y2 += speed
  156.  
  157. return 0
  158.  
  159. if __name__ == "__main__":
  160. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement