📜  带有精灵的在线 pygame 编译器 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:54.225000             🧑  作者: Mango

代码示例2
import pygame
pygame.init()
dis=pygame.display.set_mode((400,300))
 
pygame.display.set_caption('Snake game by Pythonist')
 
blue=(0,0,255)
red=(255,0,0)
 
game_over=False
while not game_over:
    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            game_over=True
    pygame.draw.rect(dis,blue,[200,150,10,10])
    pygame.display.update()
pygame.quit()
quit()