SHARE
TWEET

Untitled

a guest Aug 19th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. stops = []
  2. ball_is_stopped = False
  3.  
  4. while carryOn:
  5.     font = pygame.font.Font('freesansbold.ttf', 32)
  6.     screen.fill(OUT)
  7.  
  8.     camden.update()
  9.     robert.update()
  10.     tennisball.update()
  11.  
  12.     epsilonComp = .1
  13.     if abs(tennisball.speedx) > epsilonComp and abs(tennisball.speedy) > epsilonComp:
  14.         ball_is_stopped = False
  15.     if abs(tennisball.speedx) < epsilonComp and abs(tennisball.speedy) < epsilonComp:
  16.         ball_is_stopped = True
  17.         if not ball_is_stopped:
  18.             stops.append(1)
  19.         ball_is_stopped = True
  20.         if sum(stops) == 2:
  21.             score = 15
  22.         if sum(stops) == 3:
  23.             score = 30
  24.         if sum(stops) == 4:
  25.             score = 40
  26.         if sum(stops) == 5:
  27.             score = 0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top