Balanced Xp gains

This commit is contained in:
Sewmina
2022-04-28 02:58:07 +05:30
parent e89a44d8a1
commit 2756425cba
10 changed files with 28 additions and 20 deletions

View File

@@ -133,8 +133,11 @@ public class DBmanager : MonoBehaviour
// i
// }
level = 1 + (Mathf.Sqrt((float)xp / 100f));
Debug.Log("Level : " + (float)xp / 100f + " : " + level);
level = (Mathf.Sqrt((float)Mathf.Clamp(xp,100,float.PositiveInfinity) / 100f));
if(level == LevelInt){
level-=0.1f;
}
Debug.Log("Level : " + (float)xp / 100f + " : " + level + " : " + LevelInt);
GameManagerInstance.gameManager.RefreshData();
OnStateChanged.Invoke();
}

View File

@@ -44,7 +44,7 @@ public class GameManager : MonoBehaviour
levelTxt.text = Mathf.CeilToInt(DBmanager.Level).ToString();
float levelExcess = DBmanager.Level - Mathf.FloorToInt(DBmanager.Level);
levelSlider.value = levelExcess;
levelSlider.value = Mathf.Clamp(levelExcess, 0.1f,1);
}
}