public void fight(Unit a, Unit b)
    {
	
	int diffX = Math.abs((a.getX() + (a.getWidth() / 2)) - (b.getX() + (b.getWidth() / 2)));
	int diffY = Math.abs((a.getY() + (a.getHeight() / 2)) - (b.getY() + (b.getHeight() / 2)));
	
	if (a.getRoomX() == b.getRoomX() && a.getRoomY() == b.getRoomY() && diffX <= a.getRange() && diffY <= a.getRange())
	{
	    
	    int battleDamage = generator.nextInt(a.getDamage());
	    
	    if (b.getAttack() == true || b.getDefend() == true)
	    {
		if (b.getAttack() == true)
		{
		    battleDamage += generator.nextInt(a.getDamage());
		}
		else if (b.getDefend() == true)
		{
		    battleDamage += -(generator.nextInt(b.getDefense()));
		}
		
		if (battleDamage <= 0)
		{
		    battleDamage = 0;
		}
	    }
	    else
	    {
		battleDamage = a.getDamage();
	    }
	    
	    if (battleDamage != 0)
	    {
		b.setHealth(b.getHealth() - battleDamage);
		if (b.getHealth() <= 0)
		{
		    b.setKilled(true);
		}
	    }
	}
    }