public Blocks(int n) {		
		num = n;
		blocksPts = new Point2D.Double[num][4];
		blockPts = new Point2D.Double[4];
		isExist = new boolean[num];
		heightOfX = new int[right-left];
		Random random = new Random(System.currentTimeMillis());
		int width, height;
		for(int i = left; i < right; i ++) heightOfX[i-left] = Truck.groundY;
		for(int i = 0; i < num; i ++) {
			int x = Math.abs(random.nextInt())%(right-widthMax-left-100) + left+100, yTemp = heightOfX[x-left], leftTemp = x, rightTemp = x;
			for(int j = x; j >= left; j --)
				if(heightOfX[j-left] < yTemp) break;
				else leftTemp = j;
			for(int j = x; j < right; j ++)
				if(heightOfX[j-left] < yTemp) break;
				else rightTemp = j;
			leftTemp += dis; rightTemp -= dis;
			if(rightTemp - x <= widthMin/2 || x - leftTemp <= widthMin/2) {i --; continue;}
			height = Math.abs(random.nextInt())%heightDelta + heightMin;
			width = Math.abs(random.nextInt())%(2*Math.min(Math.min(rightTemp - x, x - leftTemp), widthDelta/2) - widthMin) + widthMin;
			blocksPts[i][0] = new Point2D.Double(x-width/2, yTemp);
			blocksPts[i][1] = new Point2D.Double(x-width/2, yTemp-height);
			blocksPts[i][2] = new Point2D.Double(x+width/2, yTemp-height);
			blocksPts[i][3] = new Point2D.Double(x+width/2, yTemp);
			for(int j = x-width/2; j < x+width/2; j ++)
				heightOfX[j-left] = yTemp - height;
			isExist[i] = true;
		}
	}