Advertisement

Need Help for a Game Menu

Started by March 22, 2000 07:58 PM
1 comment, last by Squall012 24 years, 5 months ago
I want to make a menu to either Load, Start a new game, or Exit the game, what are some really good ways to do this using DirectX, or if it must, WindowsGDI? I''m open to any and all suggestions, hope someone can help.
Well, here''s how I have done one of my menus - probably not the best way but here goes...

First you have a MENU_ITEM class, with stuff such as

int ID_TAG; //so you know what it is (use #defines)
int selected; //''cos my menus change colour when selected
sprite image; //the imagery (my menu is graphical)

Then you have an array of MENU_ITEMS, and keyboard input can just be:

menu[0].selected = 0;
menu[1].selected = 1;

curr_menu = 1;

Then when User presses key "ENTER", do this

switch (menu[curr_menu].ID_TAG)
case OPTIONS: //these are the defines..
//do actions here
case START:


drawing is much the same affair.



As you can see it is pretty primitive, but it works.

Hope this helped!

wiseGuy
Advertisement
Thanks, that gave me an idea to do what i need, its a lot better than my big long function with many many if statements that didnt work.

This topic is closed to new replies.

Advertisement