*** pong.py.old	Wed Feb 05 12:17:58 2003
--- pong.py	Fri Mar 07 09:55:58 2003
***************
*** 299,317 ****
  		player1.reinit()
  		player2.reinit()
  
- 
  def show_scores():
  	""" Print scores to screen """
! 	font = pygame.font.Font(None, 40)
  	text = str(player1.scoredpoints)
! 	score1 = font.render(text, 1, (240,240,240))
  
- 	font = pygame.font.Font(None, 40)
  	text = str(player2.scoredpoints)
! 	score2 = font.render(text, 1, (240,240,240))
  	
- 	screen.blit(background, score1.get_rect())
- 	screen.blit(background, score2.get_rect())
  	screen.blit(score1, (10,10))
  	screen.blit(score2, (595,10))
  
--- 299,317 ----
          player1.reinit()
          player2.reinit()
  
  def show_scores():
      """ Print scores to screen """
!     rect = Rect(10,10,40,40)
!     screen.blit(background, rect, rect )
!     rect = Rect(595,10,40,40)
!     screen.blit(background, rect, rect )
! 
      text = str(player1.scoredpoints)
!     score1 = score_font.render(text, 1, (240,240,240))
  
      text = str(player2.scoredpoints)
!     score2 = score_font.render(text, 1, (240,240,240))
      
      screen.blit(score1, (10,10))
      screen.blit(score2, (595,10))
  
***************
*** 390,405 ****
  	title = font.render(text, 1, (240,240,240))
  	textpos = title.get_rect()
  	textpos.centerx = background.get_rect().centerx
! 	screen.blit(title, textpos)
  
  	# Blit everything to the screen
  	pygame.display.flip()
  	
  	# Start music
  # 	music = load_sound("music.wav")
  # 	music.play(-1)
  
  	while 1:
  		for event in pygame.event.get():
  			if event.type == QUIT:
  				return
--- 390,412 ----
      title = font.render(text, 1, (240,240,240))
      textpos = title.get_rect()
      textpos.centerx = background.get_rect().centerx
!     background.blit(title, textpos)
! 
!     global score_font
!     score_font = pygame.font.Font(None, 40)
  
      # Blit everything to the screen
+     screen.blit(background, (0,0) )
      pygame.display.flip()
      
+     clock = pygame.time.Clock()
      # Start music
  #   music = load_sound("music.wav")
  #   music.play(-1)
  
      while 1:
+         # Make sure game doesn't run at more than 60 frames per second
+         clock.tick(60)
          for event in pygame.event.get():
              if event.type == QUIT:
                  return
***************
*** 434,439 ****
--- 441,447 ----
                      else:
                          screen = pygame.display.set_mode((640,480))
                          fullscreen = 0
+                     screen.blit(background, (0,0) )
  #       if server:
  #           sockobj.setblocking(0)
  #           try:
***************
*** 458,471 ****
  			if aimode:
  				ballPosition = ball.givenewpos()
  				player2.ballpos(ballPosition)
! 			screen.blit(background, ball.rect)
! 			screen.blit(bgimage, (0,0))
  			show_scores()
  			ballsprite.update()
  			playersprites.update()
  			ballsprite.draw(screen)
  			playersprites.draw(screen)
- 			screen.blit(title, textpos)
  			pygame.display.flip()
  		else:
  			font = pygame.font.Font(None, 40)
--- 466,479 ----
              if aimode:
                  ballPosition = ball.givenewpos()
                  player2.ballpos(ballPosition)
!             screen.blit(background, ball.rect, ball.rect)
!             screen.blit(background, player1.rect, player1.rect)
!             screen.blit(background, player2.rect, player2.rect)
              show_scores()
              ballsprite.update()
              playersprites.update()
              ballsprite.draw(screen)
              playersprites.draw(screen)
              pygame.display.flip()
          else:
              font = pygame.font.Font(None, 40)
