Today I added a couple of smaller features on my way to finishing up the game: a splash screen, sound effects, and music. All three things were quite a bit simpler to add than I thought they would be.
The splash screen wasn't hard once I figured out what I needed to do. I looked over some example code I found, but it was from over a year ago and some of the object names and such have since been changed, so I had to look up what the new names were, which didn't take long, but it would be nice if some of the examples I've been looking at were current at all. The splash screen just shows up for 2 seconds when the user first starts the game. The screen shows an image of the Downplay Games logo along with the AndEngine logo in the lower right. The image zooms in a little bit over the course of the 2 seconds the screen is shown.
The sound effects were also fairly easy to add. Since I already had the Sound On/Off settings flag implemented, it was pretty simple to add in a couple if statements checking if the sound flag was set, and then it plays the sound. I added in sounds for starting a game, selecting a tile to destroy, chains being destroyed, tiles being respawned, and the game ending. Currently they all play the sound file since I don't have any other files ready.
Similar to the sound effects, the music settings flag was set up already so getting the music to play was easy to implement. All pages in the game play it if the music setting is on. Unfortunately, the song restarts every time the game switches to a different page. I'm also using a place holder song for now that just loops repeatedly. If the player pauses the game on game page, the music also pauses. The music toggle button on the settings page does the same thing: the music plays when the music toggle is on and pauses when it is off.
With these additions, I'm tempted to say all the critical aspects of the game are now complete.
No comments:
Post a Comment