I want to modify the sky to be grey but i want to be time gap between the two...but i dont know how to do it

# Import a library functions called 'pygame'
import pygame

# Initialize the game engine
pygame.init()


# Define some colors
black = (0, 0, 0)
white = (255, 255, 255)
green = (0, 255, 0)
red = (255, 0, 0)
blue = (0, 0, 255)
tree = (117,58,21)
**sky = (103,205,207)**
sun = (230,208, 69)

**newsky = [103,205,205]**
color1 = 103
color2 = 205
color3 = 207

# Define some variables
pi = 3.141592653

# Set the width and height of the screen
size = [700, 500]

screen = pygame.display.set_mode(size)

pygame.display.set_caption("Black`s Cool Game")

# Loop until the user clicks the close button.
done = False

# Useed to manage how fast the screen updates
clock = pygame.time.Clock()

# --------- Main Program Loop --------
while done == False:
    # ALL EVENT PROCESSING SHOULD GO BELOW THIS COMMENT
    for event in pygame.event.get():   # User did something
        if event.type == pygame.QUIT:  # If user clicked close
            done = True    # Flag that we are done so we exit thisw loop
    # ALL EVENT PROCESSING SHOULD GO ABOVE THIS COMMENT



    # ALL GAME LOGIC SHOULD GO BELLOW THIS COMMENT


    # ALL GAME LOGIC SHOULD GO ABOVE THIS COMMENT



    # ALL CODE TO DRAW SHOULD GO BELLOS THIS COMMENT
    # Clear the screen and set the screen background
   ** screen.fill(sky)**

    # Print the grass
    pygame.draw.rect(screen,green, [0,350,700, 150],0)

    #Print first tree
    pygame.draw.rect(screen,tree, [50, 314, 16, 37], 0)
    pygame.draw.rect(screen,green, [41, 280, 34, 34], 0)
    pygame.draw.rect(screen,tree, [650, 314, 16, 37], 0)
    pygame.draw.rect(screen,green, [641, 280, 34, 34], 0)

    #Draw the House
    pygame.draw.rect(screen,blue,[250, 180, 150, 172], 0)
        #Draw the first dor
    pygame.draw.rect(screen,white,[280,315,22,36],0)
    pygame.draw.rect(screen,white,[350,315,22,36],0)
            #Draw dor open
    pygame.draw.rect(screen,black,[295,335,5,5],0)
    pygame.draw.rect(screen,black,[353,335,5,5],0)
        # Draw windows
    for i in range (0,90,30):
        for j in range(0,120,40):
            pygame.draw.rect(screen,black,[275+j,210 + i, 20,20],0)
        # Draw the roof
    pygame.draw.polygon(screen,red,[[320, 110],[230,180],[420,180]],0)


    # Draw the sun
    pygame.draw.circle(screen,sun,[670,30],55, 55)


    # ALL CODE TO DRAW SHOULD GO ABOVE THIS COMMENT

    # Go ahead and update the screen with what we`ve drawn.
    pygame.display.flip()

    # Limit to 20 frames per second
    clock.tick(20)


# Close the window and quit.
# If you forget this, the program will 'hang'
# on exit if running from IDLE
pygame.quit()

try with timer() function

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.