title: Pygame Gravity Script
body: <p>I'm trying to make a python script with pygame to simulate gravity. The problem is, my "player" keeps getting stuck at the bottom without bouncing even once. I'm using python 3.4.1 if that helps. Here's my code:</p>
  
  <pre><code>import pygame
  
  pygame.init()
  
  disp_w = 800
  disp_h = 600
  disp = pygame.display.set_mode((disp_w,disp_h))
  
  pygame.display.set_caption('Gravity')
  
  player_x = disp_w/2
  player_y = 0
  player = pygame.image.load('images/player.png')
  
  gravity = 0.1
  speed = 0
  
  clock = pygame.time.Clock()
  
  while True:
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              pygame.quit()
              quit()
  
      player_y += speed
      speed += gravity
  
      if player_y &gt; disp_h:
          speed = speed * -0.7
  
      disp.fill((0,0,0))
      disp.blit(player,(player_x,player_y))
  
      pygame.display.flip()
      clock.tick(120)
  </code></pre>