pygame.init()
screen = pygame.display.set_mode(WINSIZE)
pygame.display.set_caption('pygame Stars Example')
white = 255, 240, 200
black = 20, 20, 40
#create the background, tile the bgd image
bgdtile = load_image('background.jpg', -1)
# -1 avoid conversion to transparent background
background = pygame.Surface(SCREENRECT.size)
for x in range(0, SCREENRECT.width, bgdtile.get_width()):
for y in range(0, SCREENRECT.height, bgdtile.get_height()):
background.blit(bgdtile, (x, y))
screen.blit(background, (0,0))
#main game loop
done = 0
pygame.display.update()
NoMoreStars = False
while not done:
kill_stars(screen, stars, white) # delete
# this code just make a black rectangle:
##oground = pygame.Surface(Rect(MINX
## ,MINY,MAXX-MINX,MAXY-MINY).size)
##screen.blit(oground, (MINX,MINY))
MINX, MINY, MAXX, MAXY = move_stars(stars, NoMoreStars)
draw_stars(screen, stars, black) # draw new
pygame.display.update(MINX,MINY, MAXX-MINX, MAXY-MINY)
##pygame.display.update()