Game Menus?

BlitzMax Forums/BlitzMax Beginners Area/Game Menus?

Iridis(Posted 2006) [#1]
There has to be an easier way then this. I have really been through the mill when it comes to trying to get a game to work. I tried C++.Net and have tons of books for that, but couldn't get anywhere close to anything with it. Then I switched over to this. While it is far easier for me to understand, and I can at least get SOMETHING to load up, I am still having a heap of trouble. Not wanting to spend money on any more books, I have tried my best to look through everything posted here.
The code samples I think were right for me haven't worked, either because they are programmed in the wrong version of Blitz (as I'm using Blitz Max) or because I have just done something wrong in my ignorance.
I have tried desperately to trawl through example games, examining the code and trying to work out just HOW you get a game menu to run, but I have really come up blank here.

Any help would be much apprieciated. It'll also be an oppertunity for me to gauge the type of community around here.


Mordax_Praetorian(Posted 2006) [#2]
Firstly we need to know if you're using MAX Gui or not

Since Gui and non-gui menus are really quite different

Tip:
If you want the menus intigrated into your game directly (this will be harder), dont use Max Gui
If you dont mind them looking like windows boxes, stick with Max Gui


Dreamora(Posted 2006) [#3]

If you want the menus intigrated into your game directly (this will be harder), dont use Max Gui


I would advice using HighGUI in this case.


Iridis(Posted 2006) [#4]
Erm...I don't have Max GUI. I don't mean the actual game window, I mean the actual game itself.
Like, take the sample game Digesteroids for example. When you start that game, you have 4 options. You can begin the game, access the help screen, check the highscores for the game, and exit the game. These are all selectable with a cursor which is controled with the arrow keys.

That's the type of menu I was meaning.


Jesse(Posted 2006) [#5]
how much game programming experience do you have? have you ever programmed a game without menus?

the menu is like a program with in a game that stores information globally for the game and for itself. It runs alternatively or as part of the actual aplication main
loop:
 
.game
.
.
.
.mainloop
...if gamestart then 
......game cycle routine........'note this is not a continous loop
...else
......menu cycle routine........'note this is not a continous loop
...endif
.
.
.
.end mainloop
end game

use a global variable such as gamestart to jump from the game loop to the menu loop and visa versa. When the program starts have the variable start as 0 so that it can start at the menu. if game start is selected from the menu then have the variable switched to 1. This will prevent the menu from being displayed and will jump right in to the game. When you are killed have the variable set to 0 again so that if goes back to the menu.
this is not necessarily the best way of doing it but I found it works for me.


tonyg(Posted 2006) [#6]
Which is a GUI. As suggested, try HighGUI (or HighGUI 3)


cloned(Posted 2006) [#7]
first make a type that will hold the data for each button, then make a function for creating a button with input values so making a new one is easy

then make methods for drawing, checking collisions, modifying, deleting and anything else you could use. post if you have trouble making these and post the code(i am not just going to give out that much source code without you trying harder)


Grey Alien(Posted 2006) [#8]
try my Grey Alien BlitzMax Framework demo called "Attack of the Mutant Greys", it has a game menu like this:



and an options page like this:



My framework has all the code you need to make buttons with mouse over graphics, and menus and sub-screen etc. Plus *MUCH* more.