public void giveExp(int newExp) { if (exp < maxExp) { exp += newExp; if (exp > maxExp) { exp = maxExp; } expBar.addExp(newExp); } }