Advertisement
Guest User

Game

a guest
Apr 10th, 2020
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import pygame
  2. import random
  3.  
  4. pygame.init()
  5. screen = pygame.display.set_mode((1300, 600))
  6. pygame.display.set_caption("Genetic")
  7.  
  8.  
  9. def window():
  10.     clock = pygame.time.Clock()
  11.     screen.fill((0, 255, 0))
  12.  
  13.  
  14.  
  15. run = True
  16.  
  17.  
  18. def draw_eat(eat):
  19.     c = 0
  20.     while c <= eat:
  21.         x = random.random() * 1250 + 10
  22.         y = random.random() * 550 + 10
  23.         x = int(x)
  24.         y = int(y)
  25.         print(x, y)
  26.         radius = 10
  27.         pygame.draw.circle(screen, (66, 82, 4), (x, y), radius)
  28.         c += 1
  29.  
  30.  
  31. while run:
  32.     pygame.time.delay(100)
  33.     for event in pygame.event.get():
  34.         if event.type == pygame.QUIT:
  35.             run = False
  36.     window()
  37.     draw_eat(eat=100)
  38.     pygame.display.update()
  39. pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement