How to fix auto update of time in pygame?
<p>I am trying to make a game in which you have to click the apple and then it goes off to random position.You have 5 seconds (for now), and you have to click the apple image many times as you cant.My game works but i have two problems:<br>
1)After the game ends , the program does not respond.<br>
2)The time keeps on updating itself (it keeps on flickering) i do not want that.
How do I correct these two bugs?  </p>

<p>Here is my code:</p>

<pre><code>import pygame
import time
import random
pygame.init()

foodimg=pygame.image.load("food.png")
foodrect=foodimg.get_rect()

#Colours
white = (255,255,255)
black = (0,0,0)
red = (255,0,0)

#Game Display
display_width = 1080
display_height  = 720
gameDisplay = pygame.display.set_mode((display_width,display_height))
pygame.display.set_caption('Click It! ~ Snapnel Productions')
gameDisplay.fill((white))

font=pygame.font.SysFont("Arial",30)

a=6
running=True
while running:
    gameDisplay.fill((white))
    time=pygame.time.get_ticks()/1000
    if a==time:
        print "Game over"
        break

    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            running=False
            pygame.quit()
            quit()
        if event.type == pygame.MOUSEBUTTONDOWN:
            # Set the x, y postions of the mouse click
            x, y = event.pos
            if foodrect.collidepoint(x, y):
                foodrect.center=(random.randint(5,1060),random.randint(5,700))
                print "New Position: ",foodrect.center
                continue

    gameDisplay.blit(foodimg,foodrect)
    pygame.display.flip()
    showtime=font.render("Time: "+str(time),0,(0,0,0))
    gameDisplay.blit(showtime,(950,10))
    pygame.display.flip()
</code></pre>

<p><a href="http://i.stack.imgur.com/K1MSh.png" rel="nofollow">Here</a> is my food image.</p>