Jump to content


Photo

Creating a "back to main menu" button


  • Please log in to reply
6 replies to this topic

#1 jsimpson

jsimpson

    GMC Member

  • New Member
  • 2 posts

Posted 02 November 2011 - 12:21 AM

Hey all, first time posting here. Just had a question.

I've got a very simple game that I've been working on updating. It's a paintball style game that has a timer on it. Once the timer runs out, you input your name on the high scores dialog and then the .exe quits. To play again, you must re-launch the .exe.

My question is, how would I be able to add a button that would essentially give the player the option to "Quit" or "Back to Menu" ?

Any help is appreciated, thanks guys.
  • 0

#2 Zwelli

Zwelli

    Guy From Seattle

  • New Member
  • 97 posts
  • Version:GM8

Posted 02 November 2011 - 12:36 AM

Make two buttons, Quit and Main Menu respectively.

In one, make it exit the game. In the other, have it go to the main menu room.
Both in the left click event.

Maybe in their own room..

Simple enough?
  • 0

#3 jsimpson

jsimpson

    GMC Member

  • New Member
  • 2 posts

Posted 02 November 2011 - 12:43 AM

But I'm having trouble implementing it. How do I add it to the game? I can't get these window dialogs figured out.

Thanks for the fast reply, btw.
  • 0

#4 njrk97

njrk97

    GMC Member

  • New Member
  • 8 posts
  • Version:GM8

Posted 18 November 2011 - 09:46 PM

But I'm having trouble implementing it. How do I add it to the game? I can't get these window dialogs figured out.

Thanks for the fast reply, btw.

is it something like you have a pause sreen then you press them, cause if its like that i think just going on you obj_player keyboard press 'whater button you want for pause screen' and make in the event create instance of obj_menuscreen button at (cords of you choice) then make on the menus screen button object make mousepress, leftpress change room into (menuroom) srry if not explained well

or if theirs no pause screen just go leftclick event on obj_of menu button that important to have a button for the menu it must be an object and then place in the leftclick event warp to room(whaterever your menu rooms called) i hope this helps
  • 0

#5 interpolicer

interpolicer

    GMC Member

  • GMC Member
  • 146 posts
  • Version:GM8.1

Posted 21 November 2011 - 09:37 PM

1-Create a rectangular sprite with the text "Main Menu"
2-Make an object with that sprite
3-Place it wherever you like
4-On that object's mouse left down event, create a script with the following code: game_restart();
5-Your game will restart in the first room
  • 0

#6 Gor4k

Gor4k

    GMC Member

  • New Member
  • 46 posts

Posted 02 December 2011 - 05:15 PM

Create 2 sprites
1)spr_exit
2)spr_mainmenu

Create the objects
1)obj_exit
2)obj_mainmenu

In obj_exit add a mouse left released event. In this event add an execute code action. In the execute code add:
game_end();

In the obj_mainmenu add a mouse left released event. In this event add an execute code action. In the execute code add:
room_goto(room name);
  • 0

#7 bluehi

bluehi

    GMC Member

  • New Member
  • 1 posts
  • Version:None

Posted 08 December 2011 - 12:27 AM

thanks . so . match .
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users