-
Notifications
You must be signed in to change notification settings - Fork 3
/
bezierIngenuo.py
33 lines (27 loc) · 1.05 KB
/
bezierIngenuo.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
# -*- coding: utf-8 -*-
import sys,pygame, time,funcao_bezier
pygame.init()
screen = pygame.display.set_mode((400, 400))
screen.fill((0, 0, 0))
pygame.display.flip()
white = (255, 255, 255)
controle = 1
while True:
for event in pygame.event.get(): # um loop para checar se os eventos estão ocorrendo exemplo mouse,click,teclar
if event.type == pygame.QUIT: # quando clica no x da janela ele para o jogo
pygame.quit()
sys.exit()
if event.type == pygame.MOUSEBUTTONDOWN:
if event.button == 1: # botao esquerdo do mouse clicado
if controle == 1:
x = pygame.mouse.get_pos()
controle += 1
elif controle == 2:
y = pygame.mouse.get_pos()
controle +=1
elif controle == 3:
z = pygame.mouse.get_pos()
controle=1
funcao_bezier.bezieringenuo(screen,x,y,z)
time.sleep(0.03)
pygame.display.update()