Sign in to follow this  

Making an in game pause menu

This topic is 4302 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to make a megaman rpg game, and I need to know how to make an ingame menu. The menu would popup when the enter key is pressed. I can do the enter key part, but i have no clue how to make a menu. The menu would most likely have Folder,NetNavi,SaveGame,Library,Messages, and probably other menu items. How would i make something like this?

Share this post


Link to post
Share on other sites
Just FYI: it would be helpful if you included the language you were programming in.

Basic jist of the menu is something like the following... First, you have an activation key, which is ENTER in your case. After successfully detecting that, you would need to have a flag, something to indicate whether or not the main game code should be processed (meaning, if that flag is on, we want to display the menu while suspending the animation in the rest of the game). Next, you... draw a menu, which can be done in a number of ways, but something basic would be to just draw a primitive rectangle somewhere and put text into it. Then, you'd have to some custom-drawn buttons as well, and to process those buttons (for save, load, etc.) you'd have to do some hit testing with mouse clicks (or if the interface is purely through the keyboard, check for the user pressing whatever keys and highlight the appropriate "button") and then handle those accordingly. Then of course, however you want the user to be able to exit the menu (by hitting ESCAPE, or whatever), you'd then set that flag from earlier to indicate that the game is in the "play game" mode, rather than the "menu mode".

If you want something more code-specific, like I said, you'll have to post the language you're workin' with.

Share this post


Link to post
Share on other sites
I'm coding in Dev-CPP compiler. c++ language and windows api. Thats about it. The person making the map is using mappy. cvs map file. Is that enough info on the language and stuff?

Share this post


Link to post
Share on other sites
If you're just getting started you might want to just use the standard Windows application menu (or MFC, if that floats your boat), and have the menu show all the time. Then later you can get fancy and make it auto-hide or whatever.

I guess that kind of assumes that you're running in windowed mode, so maybe that won't be perfect, but in the absence of other information that's what I'd do.

Geoff

Share this post


Link to post
Share on other sites
Quote:
Original post by SonicD007
Im still kinda a noob. I understand what I have to do, but making a rectangle Im unsure of how to do, and making menus i have absolutly no clue how to do.

Just draw a simple rectangle. If you're doing this Megaman deal, you must at least know how to draw images, and if you can do images, then you should know how to draw points and lines, and thus, draw rectangles.

But, if menus seems confusing, then I would suggest taking a step back. Before trying to complete such a game as a Megaman RPG, shoot for something simpler, like a Tetris clone. Then, using what you learn from that, build up to the Megaman game.

Share this post


Link to post
Share on other sites
I want to make a simple game, but I'm trying to help someone make this game. I know most of the basics. Windows API all the way all the basic stuff. c++ windows api.

Also, can't I make a rectangle using RECT ?

MFC is like file edit and stuff right? If it is, I know how to do those kind of menus already. Just need to make an ingame menu. Start menu if you've played games like zelda and megaman.

Share this post


Link to post
Share on other sites
Sonic, have you done any graphical programming? Like, with the Windows GDI using brushes and pens and whatnot? Or with something a bit more advanced, like OpenGL or DirectX? That's what I mean by "drawing a rectangle."

The RECT struct is just a means of storing the bounds of a rectangle, and won't do any magical drawing for you. But, it would be wise to use a RECT struct when doing the actual drawing of the menu.

Try this resource for some basic drawing functions/techniques:

http://www.toymaker.info/Games/html/gdi.html

Share this post


Link to post
Share on other sites
Yeah SonicD007, use the articles on this site they are some of the best i have seen, I prefer OpenGL, but that is just me, go with what you like. Learn basics on OpenGL: making polygons, shading, texture mapping, adding bitmaps etc...., and then start the game. Make sure though that you know C++ pretty darn well;
(functions, classes, arrays, pointers, other object oriented stuff etc...).


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`

If you are wanting more info on Opengl, try these links:

nehe.gamedev.net/lesson.asp?index=01

www.opengl.org/resources/tutorials/

www.lighthouse3d.com/opengl/tutorials.shtml

www.gametutorials.com/Tutorials/Advanced/OpenGL.htm


For more tutorials, Google "OpenGL Tutorials"; Google the same for DirectX.


~~Mad_Koder

[Edited by - Mad_Koder on March 3, 2006 9:49:57 PM]

Share this post


Link to post
Share on other sites
Thanks for the turoial links, I just finished looking in one of the books I have and it says how to amke rectangles polygons and elipses. -.-"

Anyway, ok so now I have the rectangle.

I'm gonna look at some of the resources to see if any say how to make menus. Making menus is something I have just about no clue as to how to make. I know the basics of cPP. The things you listed i know except I need more practice wtih arrays because I've seen things about 2d arrays, and I don't really get what it is. I have a guess though because in my book I believe they do use 2d arrays.

This is an array correct?

blah[4];

And this is a 2d array?

blah[4][5]

5 means like the different states, and 4 would be like player sprites?

[Edited by - SonicD007 on March 5, 2006 10:26:31 AM]

Share this post


Link to post
Share on other sites
Yeah no problem, and just look up arrays on a site or a book, it shouldnt take long to learn it. As for 2d arrays, yes that is what they are. I am guesing you are using windows as your API? If you want to use it but likewise before, I recomend OpenGL (even though it has really given me trouble), but thats just me, Windows is easier from what I here

Share this post


Link to post
Share on other sites

This topic is 4302 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this