Text-Based Menu Tutorial (Game Maker)

Go down

Text-Based Menu Tutorial (Game Maker)

Post  FAAAEBS on Wed Aug 15, 2012 4:14 pm

Text-Based Menu Tutorial for Game Maker
This is only for those who own the Standard Version of Game Maker. I will be posting however a tutorial later on on how to do this with the lite verison

Here I will post all the steps needed to make the Text-Based Menu:
Step 1. Make a new object, and name it menu. Also make sure you decide how many options your menu will have (Play Game, Credits, Options, End Game, etc.).
Step 2. In the Create Event, put the following code:
menu_option=1 menu_options=//Amount of menu options you have
Step 3. In the Step Event write:
if menu_option>menu_options then menu_option=1
if menu_option<1 then menu_option=menu_options
Step 4. In the Key Press Down Event write:
And in the Key Press Up Event write:
Step 5. Make a script and call it draw_menu_text. Inside the script write
This is to make the Draw code less painful.
Step 6. Make a Draw Event, and inside it put the following code (I will explain how to change it to your favor later):
//Category 1
draw_menu_text(320,50,"Story Mode",c_white)
draw_menu_text(320,150,"Arcade Mode",c_white)
draw_menu_text(320,350,"End Game",c_white)
//Category 2
if menu_option=1 draw_menu_text(320,50,"Story Mode",c_red)
if menu_option=2 draw_menu_text(320,150,"Arcade Mode",c_red)
if menu_option=3 draw_menu_text(320,250,"Credits",c_red)
if menu_option=4 draw_menu_text(320,350,"End Game",c_red)
Step 7. Change the code like this:
Change font_menu to whatever font you want
Change Story Mode, Arcade Mode, Credits, and End Game to whatever your game has (add more or add less depending on your menu).
IMPORTANT: Make sure that the first function in category 2 matches the first function in category 1 (excluding the color), and the same thing with the 2nd, 3rd, and 4th functions.
Change the y coordinates of the functions, however make sure the ones in category 2 match the ones in category 1.
Step 8. In the Press Enter Key Event write this code:
if menu_option=1{room_goto_next()}
if menu_option=2{room_goto(rm_arcade_mode)}
if menu_option=3{room_goto(rm_credits)}
if menu_option=4{game_end()}
However be sure to change the function to whatever you want to happen when the player chooses that specific option.

That's it! Now you have a nice looking text-based menu, and you don't even have to give credit to me! I will be making more tutorials in the future, and if you have a specific one you want me to do, just reply to this tutorial, or pm me asking me to do one!

I'm the Admin. Pretty Cool huh? If you reach 150 Posting Points, PM me!
Members of the Month 2012: June - FAAAEBS - July - Ruca

Posts : 44
Posting Points : 482
Reputation : 318
Join date : 2012-06-13
Age : 31

View user profile http://amateurgamepublish.forumeiros.com

Back to top Go down

Re: Text-Based Menu Tutorial (Game Maker)

Post  Mr. 76 on Wed Aug 15, 2012 4:21 pm

Thanks FAAAEBS! I can clearly see that this is the exact thing you used in Contrast! Thanks a lot man!
Mr. 76

Posts : 5
Posting Points : 8
Reputation : 1
Join date : 2012-08-01

View user profile

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum