private int buildZone(int x, int maxLength) {
        int t = random.nextInt(totalOdds);
        int type = 0;

        for (int i = 0; i < odds.length; i++) {
            if(odds[ODDS_JUMP] <= t*2+30){
            	type = ODDS_JUMP;
            	break;
        }
        	if (odds[i] <= t) {
                type = i;
            }
        }

        switch (type) {
        case ODDS_STRAIGHT:
            return buildStraight(x, maxLength, false);
        case ODDS_HILL_STRAIGHT:
            return buildHillStraight(x, maxLength);
        case ODDS_TUBES:
            return buildTubes(x, maxLength);
        case ODDS_JUMP:
            if (gaps < Constraints.gaps)
                return buildJump(x, maxLength);
            else
                return buildStraight(x, maxLength, false);
        case ODDS_CANNONS:
            return buildCannons(x, maxLength);
        }
        return 0;
    }