The game has two different menus, the start menu and in-game menu, the differences are the available options and what will happen when we choose them as seen here:
- NEW > Goto player creation
- LOAD > Goto load game, Start game (Disabled)
- EXIT > Quit game
- CONTINUE > Return to game
- SAVE > Goto Save Game, Return Game (Disabled)
- EXIT > Quit Game
I have used Gimp again to draw them, to draw the ball i just made a new, square shaped image, filled it with color FF,00FF (Pink) so i can apply later the colorkey, then i selected a circle and used the blend tool with orange and yellow colors.
Drawing the button was quite easy: Gimp > File > Create > Button > Simple beveled button, the only thing I made was to left the text empty so I can use the same button for all the menu items.
The logic for the menu is simple:
- Define an "Option" variable, it will be which menu option is chosen.
- Check the keyboard, and if we have pressed the following keys:
- Key up > decrease option
- Key down > increase option
- Enter > execute action associated to the button (Change game state)
- Fill with a color (grey)
- Draw menu tittle
- Draw menu buttons
- Draw the text into the menu buttons
- Draw the ball selector
<"Game.cpp", Code for MenuStart:>
<"Game.cpp", Code for MenuGame:>
<Now the game is starting to have what we would expect to find in a game, intros, menus.. in the next post the main game loop>