Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class GameplayScreen
- {
- public Update ()
- {
- .........
- // Checking for collision of the bats
- if (ball.GetDirection() > 1.5f * Math.PI || ball.GetDirection() < 0.5f * Math.PI)
- {
- if (rightBat.GetSize().Intersects(ball.GetSize()))
- {
- ball.BatHit(CheckHitLocation(rightBat));
- }
- }
- else if (leftBat.GetSize().Intersects(ball.GetSize()))
- {
- ball.BatHit(CheckHitLocation(leftBat));
- }
- ......................
- }
- }
RAW Paste Data