Recently, I decided to return to the Asteroids game I created last year to use some of my expanded knowledge of the Godot engine and add some new quality of life features. The initial focus was on improving the art from my terrible programmer art to some better pixel art for all the sprites and backgrounds. This expanded into some small but useful features described below.
New backgrounds
I started by creating a few different backgrounds with various stars and planets to replace the original image I created when I was getting started with pixel art. The updated backgrounds use a larger colour palette to add a bit of variation. The player ship and asteroids also desperately needed updating. Again, I used a larger colour palette along with shading techniques to make them fit the style of the new backgrounds.
Since there are now multiple background images but no way to switch between them, I created a background selection menu. I wanted this to be populated dynamically usign Godot's resources so that adding new backgrounds can be done quickly and easily. The menu takes an array of background resources which require a name and image.
High scores
The game has always had a scoring system with modifiers that can multiply points scored while providing an extra challenge. However, there was no system to keep track of a high score. This was the next feature I added by saving a file in the user directory with the current high score. When a game ends, the current high score is checked and replaced if the new score is higher. To incentivise getting higher scores, I added a new property to the background resource for "required high score" which meant that to unlock and use certain backgrounds, the player must have achieved a certain high score.
Saving & loading player preferences
Finally, I decided to add some more saving and loading for the game settings, which currently includes music/sound effect volume, and the currently selected background. This system saves the values to a file in the same way as the high score system and is easy to expand on with other player preferences that may need saving in future.
Future plans
In future, I plan to expand the high score system to add scores for when different modifiers are applied which could also unlock different backgrounds, encouraging players to try out different modifiers. I also want to add some enemies that will chase or attack the player to add some extra difficulty to the game. Currently, once people have learnt the basics, it is easy to survive for a long time and achieve higher scores. Adding enemies, and updating the asteroids should help to address this issue.