Discuss Scratch

bozman
Scratcher
73 posts

How to make a Menu in your Scratch game

I myself am trying to figure out how to create a Main menu, as I haven't been able to figure it out. If you got any idea on how to do that, please tell me!
turkey3
Scratcher
1000+ posts

How to make a Menu in your Scratch game

bozman wrote:

I myself am trying to figure out how to create a Main menu, as I haven't been able to figure it out. If you got any idea on how to do that, please tell me!
There can be many types of menus, but a generic menu has start, help, and maybe options. What I do is when a menu button is clicked, it broadcasts a message “hide menu 1” to hide the main menu, and I also broadcast either “show menu 2” and have menu 2 sprites show or I broadcast play to start the game. You can check out my project here which has a pretty basic menu.
bozman
Scratcher
73 posts

How to make a Menu in your Scratch game

Awesome. Thanks for the help. That small chunk of info should definitely help me get a start on it.
beybladerevenge
Scratcher
100+ posts

How to make a Menu in your Scratch game

I have only been here for a week but the way I do my menu is that I get a sprite that is a start button and when the sprite is clicked change backdrop to _______ and hide
110Percent
Scratcher
100+ posts

How to make a Menu in your Scratch game

A great thing to do is to make your menu with a button that broadcasts “start game”.
If you already have a game that runs without a menu, simply replace all of the green flag scripts with “when I receive start game” blocks.
For example:
BEFORE MENU:
 when gf clicked
forever
if <key [left arrow v] pressed?>
point in direction (-90)
move (10) steps
end
if <key [right arrow v] pressed?>
point in direction (90)
move (10) steps
end
if <key [space v] pressed?>
do something amazing
end
AFTER MENU:
 When I receive [start game v]
forever
if <key [left arrow v] pressed?>
point in direction (-90)
move (10) steps
end
if <key [right arrow v] pressed?>
point in direction (90)
move (10) steps
end
if <key [space v] pressed?>
do something amazing
end

And in your “Start button,” you would have 2 scripts like this:
 When gf clicked
show
and
 When this sprite clicked
broadcast [start game v]

So, not only can you MAKE a main menu, but you can make one for a game that doesn't have one already. (This can be helpful for emulators)

Hope this helped!

-110%
WorldHipHopBeats
Scratcher
7 posts

How to make a Menu in your Scratch game

110Percent wrote:

A great thing to do is to make your menu with a button that broadcasts “start game”.
If you already have a game that runs without a menu, simply replace all of the green flag scripts with “when I receive start game” blocks.
For example:
BEFORE MENU:
 when gf clicked
forever
if <key [left arrow v] pressed?>
point in direction (-90)
move (10) steps
end
if <key [right arrow v] pressed?>
point in direction (90)
move (10) steps
end
if <key [space v] pressed?>
do something amazing
end
AFTER MENU:
 When I receive [start game v]
forever
if <key [left arrow v] pressed?>
point in direction (-90)
move (10) steps
end
if <key [right arrow v] pressed?>
point in direction (90)
move (10) steps
end
if <key [space v] pressed?>
do something amazing
end

And in your “Start button,” you would have 2 scripts like this:
 When gf clicked
show
and
 When this sprite clicked
broadcast [start game v]

So, not only can you MAKE a main menu, but you can make one for a game that doesn't have one already. (This can be helpful for emulators)

Hope this helped!

-110%

Excellent post, thank you.

Last edited by WorldHipHopBeats (Jan. 3, 2014 14:11:17)

meowflash
Scratcher
500+ posts

How to make a Menu in your Scratch game

I've got a game menu engine! Click here to see it!
110Percent
Scratcher
100+ posts

How to make a Menu in your Scratch game

WorldHipHopBeats wrote:

110Percent wrote:

A great thing to do is to make your menu with a button that broadcasts “start game”.
If you already have a game that runs without a menu, simply replace all of the green flag scripts with “when I receive start game” blocks.
For example:
BEFORE MENU:
 when gf clicked
forever
if <key [left arrow v] pressed?>
point in direction (-90)
move (10) steps
end
if <key [right arrow v] pressed?>
point in direction (90)
move (10) steps
end
if <key [space v] pressed?>
do something amazing
end
AFTER MENU:
 When I receive [start game v]
forever
if <key [left arrow v] pressed?>
point in direction (-90)
move (10) steps
end
if <key [right arrow v] pressed?>
point in direction (90)
move (10) steps
end
if <key [space v] pressed?>
do something amazing
end

And in your “Start button,” you would have 2 scripts like this:
 When gf clicked
show
and
 When this sprite clicked
broadcast [start game v]

So, not only can you MAKE a main menu, but you can make one for a game that doesn't have one already. (This can be helpful for emulators)

Hope this helped!

-110%

Excellent post, thank you.


No problem.
SuperSammy777
New Scratcher
2 posts

How to make a Menu in your Scratch game

For a menu i would suggest that a good way would be to use co-ordinate ranges.

if <<(mouse y) > [16]> and  <(mouse y) < [30]>

if <<(mouse x) > [-85]> and <(mouse x) < [-20]>

switch backdrop to [Game 1 v]
end
end

You would need to do this for each menu item.
You would also need to add code to each background to hide the unwanted sprites.

What are your thoughts?
SuperSammy777
New Scratcher
2 posts

How to make a Menu in your Scratch game

Just improving on what i said before…..

SuperSammy777 wrote:

For a menu i would suggest that a good way would be to use co-ordinate ranges.

if <<(mouse y) > [16]> and  <(mouse y) < [30]>

if <<(mouse x) > [-85]> and <(mouse x) < [-20]>

switch backdrop to [Game 1 v]
end
end

You would need to do this for each menu item.
You would also need to add code to each background to hide the unwanted sprites.

What are your thoughts?

Improved way:
if <<<(mouse y) > [16]> and  <(mouse y) < [30]>> and  <<(mouse x) > [-85]> and  <(mouse x) < [-20]>>
switch backdrop to [Game 1 v]
end
petcchna
Scratcher
11 posts

How to make a Menu in your Scratch game

yo lo hice con colores
d
forever

end
bunnyqueen123
Scratcher
10 posts

How to make a Menu in your Scratch game

How do you make a unique menu for a game?
ExplosionGaming
New Scratcher
1 post

How to make a Menu in your Scratch game

i want to ask where the ‘if’' block is, or do i have to create it?
deck26
Scratcher
1000+ posts

How to make a Menu in your Scratch game

ExplosionGaming wrote:

i want to ask where the ‘if’' block is, or do i have to create it?
It's the if/then block

if <> then

end
XDMLGPLAYS
Scratcher
8 posts

How to make a Menu in your Scratch game

Thanks
stop all sounds
stop all sounds
rest for () beats
deck26
Scratcher
1000+ posts

How to make a Menu in your Scratch game

XDMLGPLAYS wrote:

Thanks
stop all sounds
stop all sounds
rest for () beats
No need to necropost to thank people - this topic is from 2013 and all you've done is bring it back to the top of the forum!
Gorami
Scratcher
4 posts

How to make a Menu in your Scratch game

meowflash wrote:

I've got a game menu engine! Click here to see it!
Thank bro
FoofJr
Scratcher
100+ posts

How to make a Menu in your Scratch game

Gorami wrote:

meowflash wrote:

I've got a game menu engine! Click here to see it!
Thank bro
PLEASE do not necropost. This is a resolved topic from 7 years ago (2013!) and you do not need to thank someone. All this does is bring the topic to the top of the forum.

Powered by DjangoBB