Guest User

check for bat collision

a guest
Jun 29th, 2012
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      Class GameplayScreen
  2.         {
  3.             public Update ()
  4.                {
  5.              .........
  6.                     // Checking for collision of the bats
  7.                     if (ball.GetDirection() > 1.5f * Math.PI || ball.GetDirection() < 0.5f * Math.PI)
  8.                     {
  9.                         if (rightBat.GetSize().Intersects(ball.GetSize()))
  10.                         {
  11.                             ball.BatHit(CheckHitLocation(rightBat));
  12.                         }
  13.                     }
  14.                     else if (leftBat.GetSize().Intersects(ball.GetSize()))
  15.                     {
  16.                         ball.BatHit(CheckHitLocation(leftBat));
  17.                     }
  18.                  ......................
  19.                  }
  20.        }
RAW Paste Data