Advertisement
WilsonKoder111

Collisions!

Oct 21st, 2014
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. #New Collision Detection from /u/edbluetooth
  2.  
  3.     if  (0 < int(ball_pos[0]) <=30) and (y1 - 55 < int(ball_pos[1]) <= y1 + 55):
  4.         ball_velocity = (ball_velocity * -1)
  5.         ball_velocity[0] = random.randint(1, 11)
  6.         ball_velocity[1] = random.randint(-10, 11)
  7.  
  8.     if  (755 < int(ball_pos[0]) <=800) and (y2 - 55 < int(ball_pos[1]) <= y2 + 55):
  9.         ball_velocity = (ball_velocity * -1)
  10.         ball_velocity[0] = random.randint(-11, -1)
  11.         ball_velocity[1] = random.randint(-10, 11)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement