2017-02-05 98 views
0

林很新的蟒蛇和IM開始得到它的竅門,現在即時通訊開始使用pygame的和IM試圖用顏色填充屏幕,但它不工作由於某種原因,我的繼承人代碼Pygame填充命令不起作用?

import pygame 
pygame.init() 

white = (255,255,255) 
black = (0,0,0) 
orange = (255,165,0) 

display = pygame.display.set_mode((1280,1024)) 

pygame.display.set_caption('ReflectOS') 

Exit = False 

while not Exit: 
    for event in pygame.event.get(): 
     if event.type == pygame.QUIT: 
      Exit = true 

      display.fill(white) 
      pygame.display.update() 

     print(event) 

pygame.quit() 
quit() 

回答

0

你有錯誤的凹痕 - 只有在退出程序時才填寫屏幕

import pygame 

white = (255,255,255) 
black = (0,0,0) 
orange = (255,165,0) 


pygame.init() 
display = pygame.display.set_mode((1280,1024)) 
pygame.display.set_caption('ReflectOS') 

exit = False 

while not exit: 

    for event in pygame.event.get(): 
     if event.type == pygame.QUIT: 
      exit = True 
     print(event) 

    display.fill(white) 
    pygame.display.update() 

pygame.quit() 
quit() 
+0

謝謝!有效 – Dabest105