calculateExperienceProgress
Calculate the progress towards the next level based on current experience.
const LevelAlgorithm = require('level-algorithm');
const levelAlgorithm = new LevelAlgorithm({
baseExperience: 100,
experienceMultiplier: 1.5
});
const currentLevel = 5;
const currentExperience = 350;
const progress = levelAlgorithm.calculateExperienceProgress(currentLevel, currentExperience );
console.log(progress);
// Output:
// {
// fractional: { progress: 70.0, remaining: 30.0 },
// whole: { progress: 70, remaining: 30 }
// }Last updated