|
@ -19,6 +19,10 @@ Random random; |
|
|
xDirect(randomXDirection); |
|
|
xDirect(randomXDirection); |
|
|
|
|
|
|
|
|
int randomYDirection = random.nextInt(2); |
|
|
int randomYDirection = random.nextInt(2); |
|
|
|
|
|
yDirect(randomYDirection); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void yDirect(int randomYDirection) { |
|
|
if (randomYDirection == 0) |
|
|
if (randomYDirection == 0) |
|
|
randomYDirection--; |
|
|
randomYDirection--; |
|
|
setYDirection(randomYDirection * ballSpeed); |
|
|
setYDirection(randomYDirection * ballSpeed); |
|
|