public void add(Sprite Sprite) {
		if (leaf) {
			int loc;
			for (loc = 0; loc < maxCount; loc++) {
				if (sprites[loc] == null) {
					sprites[loc] = Sprite;
					break;
				}
			}
			if (loc >= maxCount - 1) {
				expandLeaf(Sprite);
				subdivide();
			} else if (loc == 0) {
				// Add first Sprite to new R-tree.
				Rectangle rect = Sprite.getBoundingBox();
				x = (int) rect.getX();
				y = (int) rect.getY();
				x1 = (int) (rect.getX() + rect.getWidth());
				y1 = (int) (rect.getY() + rect.getHeight());
//				x = (int) Sprite.x - 1;
//				y = (int) Sprite.y - 1;
//				x1 = (int) Sprite.x + 1;
//				y1 = (int) Sprite.y + 1;
			} else {
				expandLeaf(Sprite);
			}
		} else {
			chooseLeaf(Sprite).add(Sprite);
			expandBranch();
		}
	}