-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpygame.draw.polygon().py
More file actions
42 lines (30 loc) · 967 Bytes
/
pygame.draw.polygon().py
File metadata and controls
42 lines (30 loc) · 967 Bytes
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
# Draw Polygon
import pygame
pygame.init()
screen=pygame.display.set_mode((400,400))
pygame.display.set_caption("pygame draw()")
red = (255,0,0)
run = True
while run:
pygame.draw.polygon(screen,red,[(200,50),(300,100),(300,300),(200,350),(100,300),(100,100)]) # Draw Polygon
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
quit()
#----------------------------------------------------------------------------
import pygame
pygame.init()
screen=pygame.display.set_mode((400,400))
pygame.display.set_caption("pygame draw()")
red = (255,0,0)
run = True
while run:
pygame.draw.polygon(screen,red,[(200,50),(300,100),(300,300),(200,350),(100,300),(100,100)],20) # Draw Polygon
pygame.display.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
pygame.quit()
quit()