-
StackOverflow 文档
-
pygame 教程
-
创建一个 pygame 窗口
-
创建 pygame 窗口
import pygame
background_colour = (255,255,255) # For the background color of your window
(width, height) = (300, 200) # Dimension of the window
screen = pygame.display.set_mode((width, height)) # Making of the screen
pygame.display.set_caption('Tutorial 1') # Name for the window
screen.fill(background_colour) #This syntax fills the background colour
pygame.display.flip()
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
pygame.quit()