[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] screen.fill() not working
On Sat, Jan 10, 2009 at 12:26:20PM -0800, Yanom Mobis wrote:
> Ok, I was starting to write a game, so i wrote this code:
>
> import sys, pygame
> from pygame.locals import *
> screen = pygame.display.set_mode((500, 200),0,32)
> clock = pygame.time.Clock()
> bgc = 150, 150, 80
> redcar = pygame.image.load("redcar.png").convert_alpha()
> while True: #main loop
> clock.tick(30)
> for event in pygame.event.get(): #every game has one
> if event.type == QUIT:
> exit()
> screen.fill(bgc)
>
>
> but when I run it, the screen is black, not the color I specified.
>
--- test1.py 2009-01-10 12:27:49.000000000 -0800
+++ test2.py 2009-01-10 12:29:50.000000000 -0800
@@ -10,3 +10,4 @@
if event.type == QUIT:
exit()
screen.fill(bgc)
+ pygame.display.flip()
---
James Paige