Advertisement
Guest User

broken_bounce.c

a guest
Nov 17th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1.  GObject object = detectCollision(window, ball);
  2.             if(object != NULL)
  3.             {
  4.                 if(strcmp(getType(object), "GRect") == 0)
  5.                 {
  6.                     if(object == paddle)
  7.                     {
  8.                         YVelocity = -YVelocity;
  9.                         XVelocity = -XVelocity;
  10.                         move(ball, XVelocity, YVelocity);
  11.                     }
  12.                     else
  13.                     {
  14.                         YVelocity = -YVelocity;
  15.                         XVelocity = -XVelocity;
  16.                         move(ball, XVelocity, YVelocity);
  17.                         removeGWindow(window, object);
  18.                     }
  19.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement