@mvidberg/

Anime3

Pygame

No description

fork
loading
Files
  • main.py
  • nohup.out
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import pygame
import random
pygame.init()

red    =(255,0,0)
green  =(0,255,0)
blue   =(0,0,255)
black = (0,0,0)
screen = pygame.display.set_mode([500,500])

x = random.randint(0,500)
y = random.randint(0,500)
c = random.randint(1,3)
clock = pygame.time.Clock()

done = False

while not done:
    for event in pygame.event.get():
      if event.type == pygame.quit:
        done = True
    screen.fill(black)
    if (c==1):
      pygame.draw.circle(screen, red, [x,y] ,50)
      x = random.randint(0,500)
      y = random.randint(0,500)
      c = random.randint(1,3)
    elif(c==2):
      pygame.draw.circle(screen, blue, [x,y] ,50)
      x = random.randint(0,500)
      y = random.randint(0,500)
      c = random.randint(1,3)
    elif(c==3):
      pygame.draw.circle(screen, green, [x,y] ,50)
      x = random.randint(0,500)
      y = random.randint(0,500)
      c = random.randint(1,3)
   
for event in pygame.event.get():   # User did something
        if event.type == pygame.QUIT:  # If user clicked close
            done = True   
        pygame.display.flip()
 
        clock.tick(60)
pygame.quit()