public void addSetpiece(Set<Setpiece> allObjects)
	{

		List<Setpiece> list = new ArrayList<Setpiece>(allObjects);

		Setpiece temp = null;


		for(int a = 0; a < allObjects.size();  a++)
		{
			
			temp = list.get(a);

			int x = r.nextInt(world.length*102);
			int y = r.nextInt(world.length*102);
			int length = temp.getHeight();
			int width = temp.getWidth();

			temp.setX(x);
			temp.setY(y);
			

			if(temp.getxPos() >= 0 && temp.getxPos() <= (world.length * 102 - width) && temp.getyPos() >= 0 && temp.getyPos() <= (world.length * 102 - length))
			{

				if(world[temp.getyPos()/102][temp.getxPos()/102] == 1 && world[y/102][x/102] == 1)// && world[y/102][x/102] == 1)
				{
					//System.out.println(a+"++++++++" + temp.getX()/102 + " / " + temp.getY()/102 + " / " + (world[temp.getY()/102][temp.getX()/102] == 1));
					
					if(WhenShitHits.setpiece2setpiece(temp, list, a) == false)
					{

						if(worldObjects.containsKey(new Coordinate(length/102,width/102)))
						{

							temp.setX(x);
							temp.setY(y);

							Set<Setpiece> temp2 = worldObjects.get(new Coordinate(length/102,width/102));

							temp2.add(temp);

							count++;

						}
						else
						{

							HashSet<Setpiece> hs = new HashSet<Setpiece>();

							temp.setX(x);
							temp.setY(y);

							hs.add(temp);

							count++;

							worldObjects.put(new Coordinate(temp.getxPos()/102, temp.getyPos()/102), hs);

							hs = null;

						}

					}
					else
					{
						//System.out.println("collision!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");	
					}

				}
				else 
				{
					//System.out.println("path");

					temp.setX(0);
					temp.setY(0);

					a--;

				}


			}
			else
			{
				//System.out.println("out of bounds");
				temp.setX(0);
				temp.setY(0);

				a--;

			}


		}

		list = null;
		temp = null;

	}