forked from geekcomputers/Python
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolygon.py
More file actions
Latest commit
20 lines (16 loc) · 466 Bytes
/
Copy pathpolygon.py
File metadata and controls
20 lines (16 loc) · 466 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
importpygame, sys, time
frompygame.localsimport*
pygame.init()
window=pygame.display.set_mode((400, 300), 0, 32)
pygame.display.set_caption("Shape")
WHITE= (255, 255, 255)
GREEN= ( 0, 255, 0)
window.fill(WHITE)
pygame.draw.polygon(window, GREEN, ((146, 0), (236, 277), (56, 277)))
# Game logic
whileTrue:
foreventinpygame.event.get():
ifevent.type==QUIT:
pygame.quit()
sys.exit()
pygame.display.update()