public void move() {
        if (steps == 0) {
            Random r = new Random();
            generatedDirection = r.nextInt(4) * 90;
            int fantomX = this.getX() / 32;
            int fantomY = this.getY() / 32;
            switch (generatedDirection) {
                case 0:
                    if (level.getMap().getWallMap()[fantomX][fantomY - 1] == 1) {
                        move();
                    }
                    break;
                case 90:
                    if (level.getMap().getWallMap()[fantomX + 1][fantomY] == 1) {
                        move();
                    }
                    break;
                case 180:
                    if (level.getMap().getWallMap()[fantomX][fantomY + 1] == 1) {
                        move();
                    }
                    break;
                case 270:
                    if (level.getMap().getWallMap()[fantomX - 1][fantomY] == 1) {
                        move();
                    }
                    break;
            }
            steps = 32;
        }
    }