Rank Updates

Rank Modifications

Modified the way that ranks are calculated at the end of a level.  Before, I had S, A, and B values defined for each of the three categories (pieces, luminosity, time) for each level.  I’ve realized that I will not have enough time to come up with all of those values for even the 50 stages that I currently have.  Therefore, I’m just going to define values for the S ranks.  Then, I will derive the A, B, and C values for pieces by adding 1, 2, and 3 to the S rank.  The same goes for the luminosity value, but decreasing the value by 1, 2, and 3.  For time, I will set a base S rank time, and then calculate the A, B, C ranks by adding 2 seconds for each lower rank level.

Fixed an issue with records being wiped when New Game is selected after the game is executed again.  This is because the constructor of the PlayerRecords class was initializing all of the array values to -1.  Now the save data is loaded once when the game is started, after the rank arrays are initialized in the constructor.

The rank values now gradually appear on the game win screen.  Currently, the ding sound effect is played when each value appears.  The game is already heavy on the voice work, so I thought the letter voice work was excessive.  I may use Audacity later to modify the ding sound, so it is different for each rank or new best ranks.

Added boolean variables and methods to track if the new ranks obtained for the level are better than the previous ranks obtained for the level.  This wasn’t pretty, because the GameWinScreen doesn’t have references to the GameLevelScreen or PlayerRecords classes, so it has to keep local variables to track if each rank is the best.  The GameWinScreen then uses those boolean variables to display if the rank is a new best if appropriate.

Level Number Display

Created a static method in the Level Definition class, which takes an integer level number and converts that number into a string level name.  It divides the level number by 10 and adds 1 to get the first number, and then takes the modulo of the level number by 10 plus 1 to get the second number.  For instance, level 25 becomes “3 – 6”.  Level 10 becomes “2 – 1”.  This is the value that will be displayed to the player on the various game screens.