Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public void UserMove(RoomUser User)
  2. {
  3. if (User == null || this.Balls.Count == 0)
  4. return;
  5. foreach (RoomItem ball in this.Balls)
  6. {
  7. if (ball.GetX == User.X && ball.GetY == User.Y && (User.GoalX != ball.GetX || User.GoalY != ball.GetY))
  8. {
  9. ball.Direction = this.InverseDir(this.IntToDirection(Rotation.Calculate(User.X, User.Y, User.GoalX, User.GoalY)));
  10. ball.rebound = true;
  11. this.KickShotBall(User, ball);
  12. }
  13. if (ball.isKicked && ball.rebounds > 0)
  14. {
  15. if (ball.GetX == User.X || ball.GetY == User.Y)
  16. this.Room.SetFloorItem((GameClient) null, ball, User.X, User.Y, 0, false, true, true);
  17. this.ResetBall(ball);
  18. ball.Direction = this.InverseDir(this.IntToDirection(Rotation.Calculate(User.X, User.Y, User.GoalX, User.GoalY)));
  19. ball.rebound = true;
  20. this.KickShotBall(User, ball);
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement