Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • app app
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Ludo Pets
  • appapp
  • Merge requests
  • !43

Merged
Created May 05, 2025 by Carlos Eduardo Brito Mascarello@carlos.mascarelloDeveloper

feat(components): XpBar working with the correct mathematical logic

  • Overview 2
  • Commits 5
  • Pipelines 4
  • Changes 2

Lógica matemática xpBar

Criação da função calcLevelUp para fazer o ajuse correto da XpBar:

   const calcLevelUp = (xp: number, level: number): { xp: number; level: number } => {
    let currentXp = xp
    let currentLevel = level

    while (true) {
        const xpToNextLevel = 90 + currentLevel * 10

        if (currentXp >= xpToNextLevel) {
            currentXp -= xpToNextLevel
            currentLevel++
        } else {
            break
        }
    }

    return { xp: currentXp, level: currentLevel }
}
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feat/50-integracao-fim-quiz-firebase