private void calculateDxDy() {
        int rDx = 0;
        int rDy = 0;
        while ((rDx == rDy) && (rDx == 0)) {
            rDx = random.nextInt(3);
            rDy = random.nextInt(3);
        }
        switch (rDx) {
            case 0:
                dx = 0;
                break;
            case 1:
                dx = -1;
                break;
            case 2:
                dx = 1;
                break;
        }

        switch (rDy) {
            case 0:
                dy = 0;
                break;
            case 1:
                dy = -1;
                break;
            case 2:
                dy = 1;
                break;
        }
    }