Windows v1.1 - Fixing Code


Updated the Windows version of the game fixing several bugs:

- Levels now increase correctly when setting higher levels on the start menu and beginning play, however the GUI will reset the lines cleared to 0 for each incrementing level when playing this way. Truthfully, not my favorite fix. Would prefer if the lines cleared text continued incrementing through level advancement, but for now this solution works. Might come back to this later.

void UpdateLevel(){
    if ((startingAtLevelZero == true) || (startingAtLevelZero == false && numLinesCleared / 10 > startingLevel)){
        currentLevel = numLinesCleared / 10;         
    }         
    else if (startingAtLevelZero == false && numLinesCleared > 9){
        numLinesCleared = 0;            
        currentLevel++;
    }     
}

- High Score Names now update correctly when scoring second place.

public void UpdateHighScoreName(){         
    string tempName = playerName.text;          
    if (realScore > Game.startingHighScore){             
        PlayerPrefs.SetString("highScoreName3", highScoreName2);             
        PlayerPrefs.SetString("highScoreName2", highScoreName);             
        PlayerPrefs.SetString("highScoreName", tempName);         
    }         
    else if (realScore > Game.startingHighScore2){             
        PlayerPrefs.SetString("highScoreName3", highScoreName2);             
        PlayerPrefs.SetString("highScoreName2", tempName);         
    }         
    else if (realScore > Game.startingHighScore3){             
        PlayerPrefs.SetString("highScoreName3", tempName);         
    }     
}

- When defaulting to the start menu, the game will automatically revert to starting at Level 0. This was accomplished by simply adding the following to the Start() method in the GameMenu class (this class is separate from the Game class, which manages level advancement):

Game.startingLevel = 0;


The main priority moving forward will be the Mac port. My main goal is sharing my projects with friends and (sadly) most of them are Apple users. As such, finding a solution I can implement on my end for the permission issues is my main goal. I hope to announce success in my next update. In the meantime, please enjoy these patches to the Windows version. As always, if anyone reading and/or playing has any suggestions to either the issues with my Mac port or a better solution for the GUI display, please feel free to leave a comment. 

- T

Files

Tone-tris for Windows v1.1 53 MB
Mar 22, 2022

Get Tone-tris

Leave a comment

Log in with itch.io to leave a comment.