File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ const LEVELS = [
371371] ;
372372
373373const XP_PER_LEVEL = 45 ;
374-
374+ const NUM_LEVELS = 300 ;
375375// Load saved level or start at 0
376376let currentLevel = Number ( localStorage . getItem ( "userLevel" ) ) || 0 ;
377377
@@ -1347,7 +1347,7 @@ async function addExperience(amount) {
13471347 // 3. Process Level Ups one by one
13481348 // Using a while loop ensures that if you gain 100 XP,
13491349 // it processes Level 1, then Level 2, with the remainder left over.
1350- while ( currentXP >= XP_THRESHOLD && currentLevel < 200 ) {
1350+ while ( currentXP >= XP_THRESHOLD && currentLevel < NUM_LEVELS ) {
13511351 currentXP -= XP_THRESHOLD ;
13521352 currentLevel ++ ;
13531353 // 1. Trigger the Visual Toast (Top of screen)
@@ -1476,8 +1476,8 @@ function jumpToLevel() {
14761476
14771477 let targetLvl = parseInt ( input . value ) ;
14781478
1479- // Clamp between 0 and 200
1480- targetLvl = Math . max ( 0 , Math . min ( 200 , targetLvl ) ) ;
1479+ // Clamp between 0 and NUM_LEVELS
1480+ targetLvl = Math . max ( 0 , Math . min ( NUM_LEVELS , targetLvl ) ) ;
14811481
14821482 // Update the GLOBAL variables
14831483 currentLevel = targetLvl ;
You can’t perform that action at this time.
0 commit comments