Skip to content

Commit 3a6599c

Browse files
Merge pull request geekcomputers#104 from aaronthj16/pygame
Pygame script
2 parents 24d4938 + 7a40a24 commit 3a6599c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

polygon.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import pygame, sys, time
2+
from pygame.locals import *
3+
4+
pygame.init()
5+
window = pygame.display.set_mode((400, 300), 0, 32)
6+
pygame.display.set_caption("Shape")
7+
8+
WHITE = (255, 255, 255)
9+
GREEN = ( 0, 255, 0)
10+
11+
window.fill(WHITE)
12+
pygame.draw.polygon(window, GREEN, ((146, 0), (236, 277), (56, 277)))
13+
14+
# Game logic
15+
while True:
16+
for event in pygame.event.get():
17+
if event.type == QUIT:
18+
pygame.quit()
19+
sys.exit()
20+
pygame.display.update()

0 commit comments

Comments
 (0)