Hello ^^ This is my second question ive posted in the scratch forum.
Is there any way to make a Main menu, i already have button images i can use as sprites.
I want the Main menu to have the following options;
Start Game
Instructions
Hope someone has a solution ^^
Offline
(on the sprite of the button "start game" which can be named anything, I use startgamesprite here)
when gf clicked show
when [startgamesprite] clicked broadcast [start v] hide(on the sprite for "instructions" which can be named anything, I use instructionsprite here)
when gf clicked show
when [instructionsprite] clicked broadcast [instructions v] hideNow, when these broadcast, everything related to either starting the game, or showing the instruction, must have a script saying "When I receive []" with the proper broadcast in the blank and the rest of the script should be the actions it needs to take.
Offline
soupoftomato wrote:
(on the sprite of the button "start game" which can be named anything, I use startgamesprite here)
when gf clicked showwhen [startgamesprite] clicked broadcast [start v] hide(on the sprite for "instructions" which can be named anything, I use instructionsprite here)when gf clicked showwhen [instructionsprite] clicked broadcast [instructions v] hideNow, when these broadcast, everything related to either starting the game, or showing the instruction, must have a script saying "When I receive []" with the proper broadcast in the blank and the rest of the script should be the actions it needs to take.
You may want a special background to show on the menu. Simply switch to it at the beginning, then change to what you need with a broadcast.
You may have to add the 1st and 2nd scripts to both buttons to make them show/hide only when you want them to. And then you'll need a button to get you back to the menu from instructions. The 3rd to 5th scripts are the scripts for that third button:
when I receive [end instructions v] show when I receive [instructions v] hide when gf clicked hide when I receive [instructions v] show when [back to menu sprite] clicked broadcast [end instructions] hide
Last edited by ErnieParke (2012-07-30 07:59:04)
Offline
ErnieParke wrote:
soupoftomato wrote:
(on the sprite of the button "start game" which can be named anything, I use startgamesprite here)
when gf clicked showwhen [startgamesprite] clicked broadcast [start v] hide(on the sprite for "instructions" which can be named anything, I use instructionsprite here)when gf clicked showwhen [instructionsprite] clicked broadcast [instructions v] hideNow, when these broadcast, everything related to either starting the game, or showing the instruction, must have a script saying "When I receive []" with the proper broadcast in the blank and the rest of the script should be the actions it needs to take.
You may want a special background to show on the menu. Simply switch to it at the beginning, then change to what you need with a broadcast.You may have to add the 1st and 2nd scripts to both buttons to make them show/hide only when you want them to. And then you'll need a button to get you back to the menu from instructions. The 3rd to 5th scripts are the scripts for that third button:
when I receive [end instructions v] show when I receive [instructions v] hide when gf clicked hide when I receive [instructions v] show when [back to menu sprite] clicked broadcast [end instructions] hide
Why would you go back to the menu again?
Offline
If you go into the instructions page, then you need to go back to the menu so that you can press play. The reason for this is because the play button (in my opinion) shouldn't appear in the instructions which is because an instructions page is a page for instruction, not a menu. A menu is what is supposed to have the play button, so that is why I recommend these scripts, but it is your choice.
The alternate option is that you can make it so that you can press play both in the menu and in the instructions page. This would already be implemented if your using only soupoftomato's scripts and not both of ours.
Anyway, I hope that you have fun scripting!
Offline
Another way that I like to do it is to create a background that already has your main menu buttons as part of the bitmap. Then on the stage you can capture the mouse clicks and check the mouse x/y coordinates to see what button they clicked on. You then switch to your "instructions" background and show the instructions or start the game. Makes it so you don't have to manage so many sprites, but it bloats your project slightly with extra background images.
Offline
mwiedmann wrote:
Another way that I like to do it is to create a background that already has your main menu buttons as part of the bitmap. Then on the stage you can capture the mouse clicks and check the mouse x/y coordinates to see what button they clicked on. You then switch to your "instructions" background and show the instructions or start the game. Makes it so you don't have to manage so many sprites, but it bloats your project slightly with extra background images.
That's a nice idea and I already use it for some of my projects, but what if your buttons are circles or have rounded edges?
Last edited by ErnieParke (2012-07-30 20:23:02)
Offline
Put this in the menu:
when gf clicked switch to costume [background menu v] when I receive [start v] switch to costume [background game v]Hope that this helps!
Last edited by ErnieParke (2012-07-30 22:02:50)
Offline
ErnieParke wrote:
soupoftomato wrote:
(on the sprite of the button "start game" which can be named anything, I use startgamesprite here)
when gf clicked showwhen [startgamesprite] clicked broadcast [start v] hide(on the sprite for "instructions" which can be named anything, I use instructionsprite here)when gf clicked showwhen [instructionsprite] clicked broadcast [instructions v] hideNow, when these broadcast, everything related to either starting the game, or showing the instruction, must have a script saying "When I receive []" with the proper broadcast in the blank and the rest of the script should be the actions it needs to take.
You may want a special background to show on the menu. Simply switch to it at the beginning, then change to what you need with a broadcast.You may have to add the 1st and 2nd scripts to both buttons to make them show/hide only when you want them to. And then you'll need a button to get you back to the menu from instructions. The 3rd to 5th scripts are the scripts for that third button:
when I receive [end instructions v] show when I receive [instructions v] hide when gf clicked hide when I receive [instructions v] show when [back to menu sprite] clicked broadcast [end instructions] hide
What i just need help on is knowing what is Broadcast and its function and also When i recieve function, and why do they have to be together for script? if someone answer this that will help me a freakin ton and i wont probably be needing more help
Offline