-2

I've been trying to make a button on scratch where if you press it once, it takes you to the help screen and if you press it again, it takes you back to the main menu. If anyone knows how to do this, please help! Thank you!

2 Answers2

2

You could use two events. and you have everything on the help screen appear when one event happens, and hide when the other event occurs. Same with the main screen.

The code for the button would be something like this

when Green Flag clicked
    go to front layer
    forever
        wait until mouse down and touching mouse-pointer
        wait until not mouse down
        broadcast msg1
        wait until mouse down and touching mouse-pointer
        wait until not mouse down
        broadcast msg2

and for everything connected to the help screen,

when I receive msg1:
    show

when I receive msg2:
    hide

and for everything connected to the home screen,

when I receive msg2:
    show

when I receive msg1:
    hide
CoderTang
  • 460
  • 5
  • 14
1

If you do not understand text for some reason:

Code for button: enter image description here

Code for everything that is on main menu: enter image description here

Code for everything that's on the home menu enter image description here

ianis2002
  • 11
  • 3