As per our update schedule, my individual tasks this week were to add the pause function for the game and implement input in the high score screen. I was also supposed to work with Spandan to integrate our screens.
I implemented the pause functionality in the GameScreen, and now when the player presses (i.e. steps on) the pause button, the song stops and the arrows freeze in place. Once the player presses the pause button again, the song resumes and the arrows begin moving again. When the game is paused, the player also has other options. They can press the left arrow to restart this song, the down arrow to return to the main menu, and the right arrow to unpause (in addition to the pause button). One particularly tricky component of pausing a game like this is that I couldn’t simply stop updating the screen if the “is_paused” flag was True, since I still had to keep track of how long the game was paused for to make sure that arrows were still spawning in the right intervals. When I first implemented the pause function, if the game was paused for too long, every arrow left in the song would appear almost at the same time, since the game thought that the time to spawn those arrows had already passed. I spent some time fixing this, and now the pause function seems to work properly. It is only missing the visual menu that pops up when the game is paused, but this should be an easy addition since I only have to add it to the draw function.
I also began working on the input for the High Score screen to allow players to input their name using the arrows. So far, they can type their name and also delete characters, but the saving functionality has not been added yet, mostly because of an issue with how the keyboard was displayed. Currently, due to the difference in aspect ratio between my laptop screen and the mode screens we made in Figma, the Submit button does not fit the keyboard properly.
I’m currently working on changing how the keyboard is drawn to maintain the same aspect ratio as out model, independent of the screen’s aspect ratio (which is how the one above works). Below is the current look, but it is unfinished:
Unfortunately, Spandan was not feeling well this past week, so we did not have a chance to work together on integrating our screens. I did some work on my own, and now we can select a song in her main menu screen to play in my game screen. This upcoming week we will work some more on this, as some of the shapes and images on the screens are not sized up properly. During class on Wednesday, I also had the chance to help Tushhar test the FSRs with our plates.
Finally, I also did some small quality of life changes. As seen in the picture above, I have changed the text font on my screen to match that of the model screens we had. I also changed the choreography files to include how many segments there are in a measure for that specific song to allow for better customization and more song variety! Previously every song had 16 segments per measure, but that was somewhat restrictive.
For next week, I intend to add the pause menu interface, which shows the player what will happen depending on the arrow they step on, implement the submit button in the High Score screen, and add the files that keep track of High Scores. I also want to setup our RPi, but I am somewhat reluctant to do that since we don’t have the finished game yet. It will depend on how much progress Spandan and I make.