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

#1 2011-07-22 15:56:49

reillydow
New Scratcher
Registered: 2011-07-12
Posts: 10

how do you use sprites as a "menu"?

In a game I'm trying to create, I use the letters of the alphabet as individual sprites. When you click one to choose it, I want it to switch to another costume and have all other letters disappear.
There is a separate sprite - the hero - who should stay even after the letter is chosen. Can anyone help me do this?
If I broadcast hide, even the letter chosen gets hidden, so that doesn't work...

Thanks!
- total newbie

Offline

 

#2 2011-07-22 17:47:14

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: how do you use sprites as a "menu"?

One way to do this is to make a variable called "chosen".

Set it to 0 by default and define a number for each letter such as 1 for 'A', 2 for 'B', 3 for 'C', etc. When a letter is chosen, set the variable to the number of that letter and broadcast hide. Each letter should check if the variable is set to their 'personal number' and if it isn't, hide. The only letter that should remain unhidden is the one you have chosen.
[blocks]
<when[ letter ]clicked>
<set{ chosen  }to( personal number
<broadcast[ hide

<when I receive[ hide
<if><not> <( <{ chosen  }> <=> personal number )> >>
<hide>
<end>
[/blocks]


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#3 2011-07-22 18:53:22

silentslayer7
Scratcher
Registered: 2011-06-05
Posts: 100+

Re: how do you use sprites as a "menu"?

listen to RedNeptune and you'll be fine.


http://i51.tinypic.com/dzcwpe.gif Silentslayer7: Curator from Oct. 24 to Nov. 7

Offline

 

#4 2011-07-23 21:54:21

reillydow
New Scratcher
Registered: 2011-07-12
Posts: 10

Re: how do you use sprites as a "menu"?

thanks! how do I set a personal number for each sprite?

Offline

 

#5 2011-07-23 22:17:59

gettysburg11
Scratcher
Registered: 2008-06-14
Posts: 1000+

Re: how do you use sprites as a "menu"?

reillydow wrote:

thanks! how do I set a personal number for each sprite?

You do that in the 2nd script. When it says [blocks]<if><not> <( <{ chosen  }> <=> personal number )> >>[/blocks]
, that's how you're setting the number. You're basically saying "If it isn't x number, hide." You change the number for each sprite, which is giving it a personal number  smile


http://i256.photobucket.com/albums/hh184/mnacmilan/LOGO_ACMILAN-Splash.gif

Offline

 

#6 2011-07-23 22:26:16

reillydow
New Scratcher
Registered: 2011-07-12
Posts: 10

Re: how do you use sprites as a "menu"?

thank you, that was fast  smile  will try this tomorrow

Offline

 

#7 2011-07-24 00:04:26

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: how do you use sprites as a "menu"?

If you mean how to make a personal variable, go herewink

Offline

 

#8 2011-07-24 19:59:43

reillydow
New Scratcher
Registered: 2011-07-12
Posts: 10

Re: how do you use sprites as a "menu"?

hello again
i followed MyRedNeptune's instructions but the other sprites don't hide when I click one... andy ideas?

Offline

 

#9 2011-07-24 20:07:55

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: how do you use sprites as a "menu"?

reillydow wrote:

hello again
i followed MyRedNeptune's instructions but the other sprites don't hide when I click one... andy ideas?

As long as each of the personal numbers is unique and there aren't any other show blocks that might be causing the sprites to remain visible, it should work.  hmm


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#10 2011-07-24 20:16:16

gettysburg11
Scratcher
Registered: 2008-06-14
Posts: 1000+

Re: how do you use sprites as a "menu"?

reillydow wrote:

hello again
i followed MyRedNeptune's instructions but the other sprites don't hide when I click one... andy ideas?

Is this exactly what your scripts look like, except with the numbers changed for each individual sprite?
http://i53.tinypic.com/2v989i9.jpg


http://i256.photobucket.com/albums/hh184/mnacmilan/LOGO_ACMILAN-Splash.gif

Offline

 

#11 2011-07-25 02:46:42

emboar30
Scratcher
Registered: 2011-05-03
Posts: 100+

Re: how do you use sprites as a "menu"?

gettysburg11 wrote:

reillydow wrote:

hello again
i followed MyRedNeptune's instructions but the other sprites don't hide when I click one... andy ideas?

Is this exactly what your scripts look like, except with the numbers changed for each individual sprite?
http://i53.tinypic.com/2v989i9.jpg

If you use a forever if instead of the the if the script will be able to be used multiple times. Another way to do this is to make 26 different broadcasts for each letter and when the letter clicked you activate the letters broadcast and it will make all the other letters vanish unless u don't want them to.


http://scratch.mit.edu/static/icons/buddy/788987_med.png?t=2011-05-02+15%3A14%3A41
I is epiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiic!     See my stuff here!!!!!

Offline

 

#12 2011-07-25 02:57:34

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: how do you use sprites as a "menu"?

emboar30 wrote:

gettysburg11 wrote:

reillydow wrote:

hello again
i followed MyRedNeptune's instructions but the other sprites don't hide when I click one... andy ideas?

Is this exactly what your scripts look like, except with the numbers changed for each individual sprite?
http://i53.tinypic.com/2v989i9.jpg

If you use a forever if instead of the the if the script will be able to be used multiple times. Another way to do this is to make 26 different broadcasts for each letter and when the letter clicked you activate the letters broadcast and it will make all the other letters vanish unless u don't want them to.

Gettysburg's is simpler and that's the kind of thing I often use  tongue


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#13 2011-07-25 06:33:38

emboar30
Scratcher
Registered: 2011-05-03
Posts: 100+

Re: how do you use sprites as a "menu"?

I know - I mentioned it as an alternative method  wink


http://scratch.mit.edu/static/icons/buddy/788987_med.png?t=2011-05-02+15%3A14%3A41
I is epiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiic!     See my stuff here!!!!!

Offline

 

#14 2011-07-25 10:33:14

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: how do you use sprites as a "menu"?

MRN's wise and helpful words.

Follow them, young one, and you'll one day be like us.


xD


Hai.

Offline

 

#15 2011-07-25 19:28:15

reillydow
New Scratcher
Registered: 2011-07-12
Posts: 10

Re: how do you use sprites as a "menu"?

This is working great! Thanks all.
Didn't attempt your alternative idea emboar30, I'm not quite there yet... maybe someday  smile

Offline

 

Board footer