public void generateLevel(int y){
		int numOfPlatforms = rand.nextInt(3) + 2; //2-4
		
		int emptySpace = m.getWidth()-numOfPlatforms*PLATFORM_WIDTH - (numOfPlatforms+1)*MIN_SPACE;
		double weights[] = new double[numOfPlatforms+1];
		double spaces[] = new double[numOfPlatforms+1];
		double totalWeight = 0;
		for(int i = 0;i<numOfPlatforms+1;i++){
			weights[i] = rand.nextDouble();
			totalWeight += weights[i];
		}
		for(int i = 0;i<numOfPlatforms+1;i++){
			spaces[i] = MIN_SPACE + weights[i]/totalWeight*emptySpace;
		}
		int Xfar = (int)spaces[0];
		for(int i = 0;i<numOfPlatforms;i++){
			addPlatform(new Platform(Xfar, y, rand, MAX_NUMBER, this));
			Xfar+=(int)spaces[i+1]+PLATFORM_WIDTH;
		}
		
	}