This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-01-11 18:42:42

MadnessGames
New Scratcher
Registered: 2013-01-10
Posts: 5

How To Make a Main menu

im making a game, but each time i try and make a menu it goes very wrong!

it shows the character at the main menu and it can move around and stuff!

i want it so the character doesn't start until the game starts!

help?

Offline

 

#2 2013-01-11 18:49:48

BLU_Spy
Scratcher
Registered: 2012-01-05
Posts: 1000+

Re: How To Make a Main menu

Try using this script for the character:

when gf clicked
set [Game started v] to (0)
hide
wait (0.1) secs //A delay is needed.
wait until <(Game started) = (1)>
show
Instead of using this block...
broadcast [Game start v]
... Create a variable called "Game started" and replace the other block with this one:
set [Game started v] to (1)
And if you don't want the character to be controlled, add this to every key command:
when ["Your Key" v] key pressed
if <(Game started) = (0)>
stop script
else
"Your command"
Alternate control:
when gf clicked
forever
wait until <key ["Your Key" v] pressed?>
if <(Game started) = (0)>
stop script
else
"Your command"
Hope it helps!  wink

Last edited by BLU_Spy (2013-01-11 18:56:59)


I HAVE SWITCHED ACCOUNTS! My new username is NoxSpooth.

Offline

 

#3 2013-01-14 15:12:08

Tbtemplex97
Scratcher
Registered: 2011-11-12
Posts: 100+

Re: How To Make a Main menu

i have loads of games with main menus, pick one and look at the code, it involves using a "mode" variable and setting a button to only show if that variable is set to "mainmenu" else hide.


Online Status: http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=Tbtemplex97
Darkspace Coming Soon!, Try the Singleplayer Demo

Offline

 

#4 2013-01-14 15:19:40

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: How To Make a Main menu

Although BLU_Spy's idea will work, Tbtemplex97's idea is more flexible and efficient. I suggest you use that.


Why are the secret organizations getting all the attention?  mad

Offline

 

Board footer