Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import random
- pygame.init()
- screen = pygame.display.set_mode((1300, 600))
- pygame.display.set_caption("Genetic")
- def window():
- clock = pygame.time.Clock()
- screen.fill((0, 255, 0))
- run = True
- def draw_eat(eat):
- c = 0
- while c <= eat:
- x = random.random() * 1250 + 10
- y = random.random() * 550 + 10
- x = int(x)
- y = int(y)
- print(x, y)
- radius = 10
- pygame.draw.circle(screen, (66, 82, 4), (x, y), radius)
- c += 1
- while run:
- pygame.time.delay(100)
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- run = False
- window()
- draw_eat(eat=100)
- pygame.display.update()
- pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement