public boolean move(Direction direction, StringBuffer output) throws EndGameException{
		boolean hasMoved=false;
		if(myPosition.isCrossable(direction)){
			if (myPosition.hasCharacter(direction))
			{
				Character defender= myPosition.getCharacter(direction);
				if(attack(defender)){
					this.myPosition=myPosition.moveCharacter(direction);  //move character to the next tile
					output.append("You attacked and killed " + defender +". You moved " + direction);
					hasMoved = true;
				}
				else//defender is still alive.
				{	//if (defender.isDead()&&this.isDead()) {throw new EndGameException("Player and monster has died.  GAME OVER!");
					if(isDead()) throw new EndGameException("Player has died. GAME OVER!");
					
					output.append("You attacked: \n" + defender.toString() +"\n"+ this.toString());
				}
			}
			else
			{
				this.myPosition=myPosition.moveCharacter(direction);  //move character to the next tile
				output.append("You moved "+ direction + ".");
				
				//-- added for testing mouse events ---
				
				hasMoved = true;
			}
		}
		else
		{
			output.append(checkIfLockedExit(direction));
		}
		if(hasMoved)
		{
			//tell subscribers that the player moved in direction, and the backDir is the opposite direction
			notifyPositionChanged(direction.getOppositeDirection());
		}
		return hasMoved;
	}