test
commit
e3e2d18752
|
|
@ -0,0 +1,28 @@
|
|||
import pygame
|
||||
from pygame.locals import QUIT, KEYDOWN, K_ESCAPE
|
||||
|
||||
pygame.init()
|
||||
|
||||
SCREEN_WIDTH = 800
|
||||
SCREEN_HEIGHT = 600
|
||||
|
||||
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
|
||||
|
||||
running = True
|
||||
|
||||
surf = pygame.Surface((50, 50))
|
||||
surf.fill((0, 255, 0))
|
||||
# rect = surf.get_rect()
|
||||
screen.blit(surf, (20, 20))
|
||||
pygame.display.flip()
|
||||
|
||||
while running:
|
||||
for event in pygame.event.get():
|
||||
if event.type == KEYDOWN:
|
||||
if event.key == K_ESCAPE:
|
||||
running = False
|
||||
|
||||
if event.type == QUIT:
|
||||
running = False
|
||||
|
||||
pygame.quit()
|
||||
Loading…
Reference in New Issue