shuffle method

void shuffle(
  1. int range1,
  2. int range2
)

Implementation

void shuffle(int range1, int range2) {
  List vec = [1, -1];
  xVel =
      vec[Random().nextInt(2)] * (Random().nextInt(range2 - range1) + range1);
  yVel =
      vec[Random().nextInt(2)] * (Random().nextInt(range2 - range1) + range1);
}