public void pickUp()
	{
		boolean test=false;
		int theItem=0;

		for(int i=0; i<numItems; i++)
		{
			if(mapItems[i] != null && direction==180&&mapItems[i].location.x==location.x-1&&mapItems[i].location.y==location.y)
			{
				test=true;
				theItem=i;
				break;
			}
			else if(mapItems[i] != null &&direction==0&&mapItems[i].location.x==location.x+1&&mapItems[i].location.y==location.y)
			{
				test=true;
				theItem=i;
				break;
			}
			else if(mapItems[i] != null &&direction==270&&mapItems[i].location.y==location.y+1&&mapItems[i].location.x==location.x)
			{
				test=true;
				theItem=i;
				break;
			}
			else if(mapItems[i] != null &&direction==90&&mapItems[i].location.y==location.y-1&&mapItems[i].location.x==location.x)
			{
				test=true;
				theItem=i;
				break;
			}
		}

		if(!test||mapItems[theItem].found)
			return;

			repaint();

			messageBox=new ErrorWindow();

			if(mapItems[theItem].startsWithVowel())
				messageBox.addMessage("You found an "+mapItems[theItem].type+"!","Found Item!");
			else
				messageBox.addMessage("You found a "+mapItems[theItem].type+"!","Found Item!");

			messageBox.repaint();
			Inventory.addItem(mapItems[theItem]);
			mapItems[theItem].found=true;
			while(messageBox.isVisible())
			{
				try
				{
					repaint();
					Thread.sleep(10);
				}
				catch(Exception ignored){}
			}

			jf.toFront();

		for(int i=0; i<foundItem.length; i++)
		{
			foundItem[i]=mapItems[i].found;
		}

		saveItemData();
		performingAction=false;
	}