Pygame simple issue, object movement and display
<pre><code>    player_1 = pygame.image.load(player1)
    #

    def player1(x,y):
        window.blit(player_1, (x,y))

    x =  (110)
    y = (150)
    x_change = 0
    y_change = 0
    player1_speed = 0

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

            if event.type == pygame.KEYDOWN:
               if event.key == pygame.K_LEFT:
                x_change = -5
               elif event.key == pygame.K_RIGHT:
                  x_change = 5

               elif event.key == pygame.K_UP:
                  y_change = -5

              elif event.key == pygame.K_DOWN:
                 y_change = 5

        if event.type == pygame.KEYUP:
        if event.key == pygame.K_LEFT or event.key == pygame.K_RIGHT or event.key == pygame.K_UP or event.key == pygame.K_DOWN:
            x_change = 0


        x += x_change
        y += y_change        

        player1(x,y)
        pygame.display.update()
        fpsClock.tick(60)
        screen.blit(background_surface, (0,0))

# update display
pygame.display.flip()
</code></pre>

<p>Hi, I have a program where unfortunatley when moving the object, it moves left &amp; right perfectly but up and down does not seem to stop. There is also an issue of the screen flashing. Sorry for the long question but any help would be appreciated. Thanks</p>