public boolean canMove()
	{
		if(cartographer)
		return true;

		//Begin Trainer Test

		switch(direction)
		{
			case 0:
				for(int i=0; i<numTrainers; i++)
				{
					if(trainer[i] != null && location.x+1==trainer[i].location.x&&location.y==trainer[i].location.y)
						return false;
				}
				break;
			case 90:
				for(int i=0; i<numTrainers; i++)
				{
					if(trainer[i] != null && location.y-1==trainer[i].location.y&&location.x==trainer[i].location.x)
						return false;
				}
				break;
			case 180:
				for(int i=0; i<numTrainers; i++)
				{
					if(trainer[i] != null && location.x-1==trainer[i].location.x&&location.y==trainer[i].location.y)
						return false;
				}
				break;
			case 270:
				for(int i=0; i<numTrainers; i++)
				{
					if(trainer[i] != null && location.y+1==trainer[i].location.y&&location.x==trainer[i].location.x)
						return false;
				}
				break;
		}

		//Begin Overworld Item Test

		switch(direction)
		{
			case 0:
				for(int i=0; i<numItems; i++)
				{
					if(!mapItems[i].found&&mapItems[i] != null && location.x+1==mapItems[i].location.x&&location.y==mapItems[i].location.y)
						return false;
				}
				break;
			case 90:
				for(int i=0; i<numItems; i++)
				{
					if(!mapItems[i].found&&mapItems[i] != null && location.y-1==mapItems[i].location.y&&location.x==mapItems[i].location.x)
						return false;
				}
				break;
			case 180:
				for(int i=0; i<numItems; i++)
				{
					if(!mapItems[i].found&&mapItems[i] != null && location.x-1==mapItems[i].location.x&&location.y==mapItems[i].location.y)
						return false;
				}
				break;
			case 270:
				for(int i=0; i<numItems; i++)
				{
					if(!mapItems[i].found&&mapItems[i] != null && location.y+1==mapItems[i].location.y&&location.x==mapItems[i].location.x)
						return false;
				}
				break;
		}

		int test=0;

		switch(direction)
		{
			case 0:
				if(location.x<getAreaWidth())
				test=currentArea[location.x+1][location.y];
				else
					return false;
				break;
			case 90:
				if(location.y>0)
				test=currentArea[location.x][location.y-1];
				else
					return false;
				break;
			case 180:
				if(location.x>0)
				test=currentArea[location.x-1][location.y];
				else
					return false;
				break;
			case 270:
				if(location.y<getAreaHeight())
				test=currentArea[location.x][location.y+1];
				else
					return false;
				break;

		}

		if (tileSet == OUTDOORS)
		{
			switch(test)
			{
				//Jump Over Cases
				//Recursion is used so that user doesn't
				//jump into objects
				case 137:
				case 84:
					if(direction==270)
					{
						location.y++;
						if(canMove())
						{
							try
							{
								Thread.sleep(250);
								repaint();
							}
							catch(Exception ignored){}
							return true;
						}
						else
						location.y--;
						return false;
					}
					else
						return false;
				case 139:
				case 87:
					if(direction==180)
					{
						location.x--;
						if(canMove())
						{
							try
							{
								Thread.sleep(250);
								repaint();
							}
							catch(Exception ignored){}
							return true;
						}
						else
						location.x++;
						return false;
					}
					else
						return false;
				case 141:
				case 89:
					if(direction==0)
					{
						location.x++;
						if(canMove())
						{
							try
							{
								Thread.sleep(250);
								repaint();
							}
							catch(Exception ignored){}
							return true;
						}
						else
						location.x--;
						return false;
					}
					else
						return false;
				//Standard Cases
				case 0:
				case 23:
				case 27:
				case 157:
				case 187:
				case 4:
				case 40:
				case 42:
				case 5:
				case 6:
				case 85:
				case 9:
				case 90:
				case 144:
				case 226:
				case 239:
				case 161:
					if(surfing)
					{
						surfSong.stop();
						bgm.loop();
					}
					surfing=false;
					return true;
				//Surfing Cases
				case 19:
				case 205:
					if(surfing)
						return true;
				case 1:
				case 10:
				case 12:
				case 13:
				case 14:
				case 15:
				case 16:
				case 8:
				case 204:
				case 206:
				case 207:
				case 208:
				case 209:
				case 210:
				case 211:
					if ((Inventory.hasItem(new Item(Item.Type.HM,1,3)))&&!surfing&&Mechanics.hasSurf(partyPokemon))
					{
						useSurf();
						return true;
					}
					else if(surfing)
						return true;
//					else if(surfing)
//					{
//						surfing=false;
//						surfSong.stop();
//						bgm.loop();
//						return true;
//					}
				default:
					return false;
			}
		}
		else if (tileSet == INDOORS)
		{
			switch(test)
			{
				//Ice Logic
				case 190:
					switch(direction)
					{
						case 0:
							while(location.x<getAreaWidth()-1&&currentArea[location.x+1][location.y]==190)
							{
								location.x++;
								try
								{
									repaint();
									Thread.sleep(100);
								}
								catch(Exception ignored){}
							}
							break;
						case 90:
							while(location.y>0&&currentArea[location.x][location.y-1]==190)
							{
								location.y--;
								try
								{
									repaint();
									Thread.sleep(100);
								}
								catch(Exception ignored){}
							}
							break;
						case 180:
							while(location.x>0&&currentArea[location.x-1][location.y]==190)
							{
								location.x--;
								try
								{
									repaint();
									Thread.sleep(100);
								}
								catch(Exception ignored){}
							}
							break;
						case 270:
							while(location.y<getAreaHeight()&&currentArea[location.x][location.y+1]==190)
							{
								location.y++;
								try
								{
									repaint();
									Thread.sleep(100);
								}
								catch(Exception ignored){}
							}
							break;
					}
					break;
				case 0:
				case 1:
				case 2:
				case 3:
				case 18:
				case 22:
				case 30:
				case 60:
				case 61:
				case 65:
				case 66:
				case 52:
				case 89:
				case 90:
				case 54:
				case 102:
				case 108:
				case 116:
				case 113:
				case 117:
				case 127:
				case 128:
				case 129:
				case 132:
				case 133:
				case 134:
				case 142:
				case 154:
				case 155:
				case 156:
				case 157:
				case 164:
				case 165:
				case 103:
				case 159:
				case 158:
				case 167:
				case 179:
				case 193:
				case 203:
				case 219:
				case 211:
				case 217:
				case 207:
				case 222:
				case 231:
				case 236:
				case 237:
				case 256:
				case 270:
				case 197:
				case 273:
				case 276:
				case 277:
				case 284:
				case 285:
				case 296:
				case 313:
				case 307:
				case 299:
				case 294:
				case 292:
				case 331:
				case 333:
				case 334:
				case 335:
				case 336:
				case 342:
				case 343:
				case 240:
				case 344:
				case 345:
				case 346:
				case 353:
				case 354:
				case 355:
				case 356:
				case 360:
				case 364:
					if(surfing)
					{
						surfSong.stop();
						bgm.loop();
					}
					surfing=false;
					return true;
				case 244:
					if (surfing)
					return true;
				case 241:
				case 242:
				case 243:
				case 245:
				case 246:
					if ((Inventory.hasItem(new Item(Item.Type.HM,1,1)))&&!surfing&&Mechanics.hasSurf(partyPokemon))
					{
						useSurf();
						return true;
					}
					else if(surfing)
						return true;
				default:
					return false;
			}
		}

		return false;
	}