forked from textchimp/pyth02
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gfx.py
47 lines (35 loc) · 949 Bytes
/
gfx.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
47
import pygame
import sys
import random
pygame.init()
# info = pygame.display.Info()
# screen = pygame.display.set_mode((info.current_w - 200, info.current_h))
screen = pygame.display.set_mode((800,600))
# screen = pygame.display.set_mode((0,0),pygame.FULLSCREEN)
screen.fill(0)
def ri(max=255):
return random.randint(0, max)
while True:
for event in pygame.event.get():
if event.type == pygame.KEYDOWN:
# and event.key == pygame.K_ESCAPE:
pygame.quit()
sys.exit()
# pygame.draw.rect(
# screen,
# (ri(), ri(), ri()),
# (ri(640), ri(480), ri(200), ri(200)),
# 4
# )
# screen.fill(0)
mx, my = pygame.mouse.get_pos()
# pygame.draw.rect(screen, (255,0,0), (mx, my, 20, 20), 0)
pygame.draw.circle(
screen,
(ri(), ri(), ri()),
(mx, my),
10,
0
)
pygame.display.update()
# end of main while draw loop