I took a break from engine programming, and I started working on some of the graphical and audio aspects of the game. I would like to have a small playable demo in the near future. For now I am just using royalty free assets, but I would like to go back later and make my own custom art and music. The font I used is called Ethnocentric, which was downloaded from 1001freefonts.com. Be careful to read the license agreement for any font downloaded form this site, because not all give you permission to use the font for sale in commercial works. However, most fonts allow inclusion in commercial works as long as the font is not modified or sold as a part of a font compilation. The title background texture was acquired from CGTextures.com, which allow use of their textures as long as those are not sold as a part of a texture compilation and it is not used in an open source project. For the background music, I used two songs from Kevin MacLeod’s incompetech site. Again, I would like to make my own music in the future, but for now I will use those pieces which only require attribution in the credits screen.
Again, writing good code to play music can be more difficult than it looks. When going from the game to a menu, I would like the music to change. However, I don’t want to game music to start all over again when going back to the game. I could just have the game music play through the menu at a lower volume. One idea I had was to create a Song variable in the ResistorKit screen class, since usually one only song is associated with each Screen type. I would just need to have methods to modify it, so that the music could be changed for each game screen. Additionally, it would be nice to have a way for the music to fade from one song to another when changing areas in the game world.
I reworked some of the screen handling code to add the new credits screen. One problem is that the “QUIT” state did not have a corresponding screen, so I made a dummy quit screen so that the game states are aligned with the game screens. I can probably also use the quit screen to display information as the game is closing, such as “thank you for playing” or information on how to buy if the game is running in trial mode.
On the title screen, I went ahead and implemented a scrolling background. This seems to be a running theme in my games. I set the scroll rate to 8 pixels per frame, so it scrolls really quickly. I may need to slow it down if it makes people dizzy.
On the game screen, I went ahead and updated the bounding box display code so that when the instance variable that controls its display is set to true, then the bounding boxes for all game objects (player, enemies, collectibles, projectiles) are displayed. I also updated the graphic for the player’s projectile, using a supernova effect that I created with Gimp but I’m still not happy with it.