@ -60,7 +60,7 @@ void State_LevelComplete::OnStateChange(GameState*prevState){
Component < ProgressBar > ( MenuType : : LEVEL_COMPLETE , " XP Bar " ) - > ResetProgressBar ( game - > GetPlayer ( ) - > CurrentXP ( ) , game - > GetPlayer ( ) - > NextLevelXPRequired ( ) ) ;
accumulatedXP = game - > GetPlayer ( ) - > GetAccumulatedXP ( ) ;
gainRate = ( game - > GetPlayer ( ) - > NextLevelXPRequired ( ) * 0.5f ) / 60.f ;
gainRate = ( game - > GetPlayer ( ) - > NextLevelXPRequired ( ) * 0.5f ) ;
float xpBonus = 1.1f ; //10% XP bonus for finishing a stage.
if ( Component < MenuLabel > ( LEVEL_COMPLETE , " Stage Complete Label " ) - > GetLabel ( ) ! = " Stage Summary " ) { //If the label says stage summary, we didn't actually complete the level. Don't reward any stage items to the player.
@ -106,7 +106,7 @@ void State_LevelComplete::OnUserUpdate(AiL*game){
if ( accumulatedXP > 0 ) {
Audio : : Engine ( ) . SetVolume ( xpGainSound , Audio : : GetCalculatedSFXVolume ( 0.6f ) ) ;
if ( lastXPGain < = 0.f ) {
int incrementAmt = gainRate * game - > GetElapsedTime ( ) + 1 ;
int incrementAmt = gainRate * ( 1 / 60.f ) + 1 ;
accumulatedXP = std : : max ( 0 , accumulatedXP - incrementAmt ) ;
auto progressBar = Component < ProgressBar > ( MenuType : : LEVEL_COMPLETE , " XP Bar " ) ;
progressBar - > UpdateProgressBar ( progressBar - > GetCurrentProgress ( ) + incrementAmt ) ;