Need Help for a Game Menu
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement