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

#1 2012-12-22 13:01:34

kelton8or
New Scratcher
Registered: 2012-05-13
Posts: 5

Need Help Scripting

I am trying to script a game where i click a menu button and all the other sprites hide. Is there a way to make it so that when i click one sprite it changes or affects the other.

Offline

 

#2 2012-12-22 13:44:55

Ideas
Scratcher
Registered: 2012-10-07
Posts: 100+

Re: Need Help Scripting

Hello welcome to scratch have fun scripting and don't be afraid to ask questions, you can do it and it is quite simple.
Add these to the sprite you want clicked

when gf clicked
set [hiding v] to [0]
show
and this:
when [sprite 1] clicked
if <(hiding)=[0]>
set [hiding v] to [1]//any variable which only contains 0's and 1's mean 0 off 1 on
else
set [hiding v] to [0]
end
add these to the other sprites
when gf clicked
forever
if <(hiding)=[1]>
hide
else
show
end


http://img685.imageshack.us/img685/2010/screenshot20121110at132.pngI think that you must CLICK above

Offline

 

#3 2013-01-18 17:51:11

AgentCNF
Scratcher
Registered: 2012-08-27
Posts: 21

Re: Need Help Scripting

Easy!

Here ya go! Add this one on the menu button:

when (menubutton) clicked
broadcast <hide>
And put this script on the ones you want to hide.

when I receive <hide>
hide

Last edited by AgentCNF (2013-01-21 21:03:05)


Go St. Louis Cardinals!!! I Hate The Cubs!

Offline

 

#4 2013-01-18 18:01:30

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

Re: Need Help Scripting

AgentCNF wrote:

Duh! Easy!

Here ya go! Add this one on the menu button:

when (menubutton) clicked
broadcast <hide>
And put this script on the ones you want to hide.

when I receive <hide>
hide

No offense, but the 'Duh' sounded a bit rude...


I HAVE SWITCHED ACCOUNTS! My new username is NoxSpooth.

Offline

 

#5 2013-01-21 21:02:53

AgentCNF
Scratcher
Registered: 2012-08-27
Posts: 21

Re: Need Help Scripting

BLU_Spy wrote:

AgentCNF wrote:

Duh! Easy!

Here ya go! Add this one on the menu button:

when (menubutton) clicked
broadcast <hide>
And put this script on the ones you want to hide.

when I receive <hide>
hide

No offense, but the 'Duh' sounded a bit rude...

LOL sorry didn't mean it to be.


Go St. Louis Cardinals!!! I Hate The Cubs!

Offline

 

Board footer