屏幕填充无效

时间:2016-05-27 23:33:24

标签: python pygame

所以我反对这个奇怪的问题,我无法填满屏幕。我的代码是

#Import all modules
import pygame
import random
import math
import time

#Colors
BLACK = ( 0, 0, 0)
WHITE = ( 255, 255, 255)
GREEN = ( 0, 255, 0)
RED = ( 255, 0, 0)
ORANGe = (255, 115, 0)
YELLOW = (242, 255, 0)
BROWN = (115, 87, 39)
PURPLE = ( 298, 0, 246)
GRAY = ( 168, 168, 168)
BLUE = ( 0, 0, 255)
pygame.init()
# Clock
clock = pygame.time.Clock()
#Screen
screenx = 1000
screeny = 700
screen = pygame.display.set_mode([screenx,screeny])

#Title
pygame.display.set_caption("OUCH Version 0.1")
#Classes (if any)

#Variables
sound = True
password = False
titlescreen = True

#Booleans




#Sounds



#The graphics


#Positions


#Time management
fps = 60

#Other Things


#Main Loop__________________________________________________
done = False

while not done:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            done = True

    if titlescreen:

        screen.fill(WHITE)





    #Flip the Display
    pygame.display.flip
    clock.tick(fps)

#If done

pygame.quit()

我刚刚更新到python 3.4,可能是问题所在。或者我忽略了什么。我试图将屏幕填满白色但每次运行时屏幕总是变成黑色。感谢您的任何帮助。 :)

我尝试了什么__________

我试着看他们的颜色是白色的东西,但当我尝试任何其他颜色它不起作用。我也试过只用屏幕填充应该布尔但是它也不起作用。我也试过不做如果titlescreen:,但如果titlescreen == True:那么bla bla

1 个答案:

答案 0 :(得分:1)

你忘了把手柄放在一边:

pygame.display.flip()