Jump to content


Photo

Restart/end Game Buttons


  • Please log in to reply
7 replies to this topic

#1 undoingearth

undoingearth

    GMC Member

  • New Member
  • 37 posts

Posted 02 November 2008 - 04:44 AM

i have a room for a game over screen
i have it made and every thing works right
but i want to have 2 buttons you can click on

one saying restart level
one saying end game
(bet you can figure out what those do)


also how would i make a screen for when the game starts that would have a button that says start game
and how would i make that screen show first
  • 0

#2 gamemaker7pro

gamemaker7pro

    GMC Member

  • New Member
  • 252 posts

Posted 02 November 2008 - 04:47 AM

i have a room for a game over screen
i have it made and every thing works right
but i want to have 2 buttons you can click on

one saying restart level
one saying end game
(bet you can figure out what those do)


also how would i make a screen for when the game starts that would have a button that says start game
and how would i make that screen show first

all you do is make the two buttons objects, then in the restart level part in left click you put
room_restart()
and for the end game you put
game_end()

  • 0

#3 undoingearth

undoingearth

    GMC Member

  • New Member
  • 37 posts

Posted 02 November 2008 - 05:09 AM

all you do is make the two buttons objects, then in the restart level part in left click you put

room_restart()
and for the end game you put
game_end()



what goes in the ()
  • 0

#4 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8991 posts
  • Version:GM:Studio

Posted 02 November 2008 - 05:18 AM

Nothing.
  • 0

#5 undoingearth

undoingearth

    GMC Member

  • New Member
  • 37 posts

Posted 02 November 2008 - 05:50 AM

Nothing.



ok...
  • 0

#6 Botyto

Botyto

    GMC Member

  • GMC Member
  • 1252 posts

Posted 02 November 2008 - 06:46 AM

and for the "start game button", use this code when it's being clicked
room_goto(rm) //where rm is the room name
  • 0

#7 Katuko

Katuko

    GMC Member

  • GMC Member
  • 5687 posts

Posted 02 November 2008 - 09:31 AM

what goes in the ()


Functions that need arguments like x, y, speed, direction, etc will need to have them filled in (they will also tell you in the code editor). For functions that don't need any input, like game_end(), just leave them empty. They still need to be there, however.
  • 0

#8 osl

osl

    GMC Member

  • New Member
  • 143 posts

Posted 02 November 2008 - 11:47 AM

You can do it with drag and drop too. There is a game end button, and a restart game button, you know. Put in your restart button object in a left click event, and put restart game, and in the other button, just change the restart game action, with an end game action. Any easy than code? lol, i only use code if I am desperate.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users