Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1.     ball_is_stopped = False
  2.     stops = 0
  3.     if abs(tennisball.speedx) < epsilonComp and abs(tennisball.speedy) < epsilonComp:
  4.         ball_is_stopped = True
  5.         if ball_is_stopped:
  6.             stops += 1
  7.         if stops == 2:
  8.             score = 15
  9.         if stops == 3:
  10.             score = 30
  11.     scorebox = font.render(str(score), True, WHITE, BLACK)
  12.     scoreRect = scorebox.get_rect()
  13.     scoreRect.center = (625, 50)
  14.     screen.blit(scorebox, scoreRect)
  15.  
  16.     for event in pygame.event.get():
  17.         if event.type == pygame.QUIT:
  18.             carryOn = False
  19.         elif event.type == pygame.KEYDOWN:
  20.             if event.key == pygame.K_x:
  21.                 carryOn = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement