public void detectNearbyObjects() {
		for (MaskObject o1 : mapObjects) { // the coordinates are wrong, but its
											// too annoying to change all of the
											// code so it will stay this way
			for (MaskObject o2 : mapObjects) {
				int checkX;
				int checkY;

				checkX = o2.posX - o1.posX;
				checkY = o2.posY - o1.posY;
				if ((checkX == -1 || checkX == 0 || checkX == 1)
						&& (checkY == -1 || checkY == 0 || checkY == 1))
					o1.setBlockedAtDirection(checkX, checkY);

				/*
				 * // all the checking for the objects are done in
				 * the above four lines 
				 * east = false; south = false; 
				 * west = false; north = false;
				 * 
				 * if ((o1.posX == (o2.posX-1)) && ( o1.posY == (o2.posY-1) ||
				 * o1.posY == o2.posY || o1.posY == (o2.posY+1) )) north = true;
				 * else if (o1.posX == (o2.posX+1)&& ( o1.posY == (o2.posY-1) ||
				 * o1.posY == o2.posY || o1.posY == (o2.posY+1) )) south = true;
				 * if (o1.posY == (o2.posY-1) && ( o1.posX == (o2.posX-1) ||
				 * o1.posX == o2.posX || o1.posX == (o2.posX+1) )) west = true;
				 * else if (o1.posY == (o2.posY+1) && ( o1.posX == (o2.posX-1)
				 * || o1.posX == o2.posX || o1.posX == (o2.posX+1) )) east =
				 * true;
				 * 
				 * if (north && west) o1.setBlockedNearby(7); else if (north)
				 * o1.setBlockedNearby(6); else if (north && east)
				 * o1.setBlockedNearby(5); else if (west)
				 * o1.setBlockedNearby(4); else if (east)
				 * o1.setBlockedNearby(3); else if (south && west)
				 * o1.setBlockedNearby(2); else if (south)
				 * o1.setBlockedNearby(1); else if (south && east)
				 * o1.setBlockedNearby(0);
				 */
			}
		}
	}