【发布时间】:2022-01-23 04:53:55
【问题描述】:
我是 Macbook 用户,最近才开始学习使用 python 编程游戏。 我的问题是每次我尝试关闭屏幕时它都不会关闭。
import pygame
import sys
pygame.init()
width = 800
hight = 600
screen = pygame.display.set_mode((width , hight))
game_over= False
while not game_over:
for event in pygame.event.get():
if event.type == pygame.QUIT :
sys.exit()
当我将光标指向屏幕时,它会变成一个圆圈...Cursur,所以通常我只需按强制退出“on the snake icone”在停靠栏中 那么我该如何解决这个问题并通过按下关闭按钮来关闭屏幕呢? 我正在使用python 3。 谢谢。
【问题讨论】:
标签: python macos pygame anaconda sublimetext3