如果在游戏或应用程序退出时遇到了“video system not initialized”的错误,可能是因为pygame的视频系统在程序退出时没有正确清理。确保在程序退出时调用pygame.quit()函数来关闭pygame。例如: import pygame pygame.init() # 游戏或应用程序的代码... pygame.quit() 检查视频驱动程序如果你在使用特定的视频驱动程序(...
pygame.error:videosystemnotinitialized 在pygame写游戏出现pygame.error: video system not initialized 源代码 import sys import pygame def run_game():pygame.init()screen = pygame.display.set_mode((1200,800))pygame.display.set_caption("Alien Invasion")#主循环 while True:#监视键盘和⿏标事件 for ...
前提已经有初始化: pygame.init()#游戏初始化 1. 如果报错是因为这里: 实际上应该是:quit大小写的原因,修改后如下 #开始写回圈 running=True#开始游戏肯定是继续,所以true whilerunning: #取得输入 clock.tick(FPS)#一秒钟最多执行60次,每个人的电脑每秒钟执行次数不一样,所以要控制 foreventinpygame.event.ge...
pygame.error: video system not initialized 前提已经有初始化: pygame.init() # 游戏初始化 #开始写回圈running = True #开始游戏肯定是继续,所以truewhile running: #取得输入 clock.tick(FPS) #一秒钟最多执行60次,每个人的电脑每秒钟执行次数不一样,所以要控制 for event in pygame.event.get(): if ev...
python中video system not initialized怎么解决,今天在github上找到一个用pygame做的Python游戏,但是clone到本地运行的时候却冒出了“mixersystemnotinitialized”这样的问题。其实这句话说的就是音频混音器(具体指的就是双击右下角小喇叭图标后弹出的音量控制台)没有初
针对你遇到的问题“pygame.error: video system not initialized”,以下是根据你提供的提示进行的详细分析和解答: 确认pygame.init()是否已正确调用以初始化视频系统: 在使用pygame的任何图形或事件功能之前,必须调用pygame.init()来初始化pygame模块。如果没有正确初始化,就可能会遇到“video system not initialized”的...
pygame.error: video systemnotinitialized thank you :) You should stop your main loop when you want to exit the game. My suggestions, either of callexit()afterpygame.quit() setfinish = Trueandstart = False(though due to some indentation issues with your pasted code it's not possible to ...
在pygame写游戏出现pygame.error: video system not initialized 源代码 import sys import pygame def run_game(): pygame.init() screen = pygame.display.set_mode((1200,800)) pygame.display.set_caption("Alien Invasion") #主循环 while True: ...
Why is this arises: for event in pygame.event.get(): pygame.error: video system not initialized, and if I put pygame.quite() outside of while loop then it stops working.(not able to quit) importpygame WIDTH, HEIGHT =900,500WIN = pygame.display.set_mode((WIDTH,HEIGHT))...
pygame.error: video system not initialized 经过不懈的努力意识到了自己的问题,我将QUIT写成了 quit(),大家在使用pycharm等IDE的时候也要充分关注,提示的对不对。 --正确代码 def run_game(self): while True: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() pygame....