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

#1 2012-02-03 20:46:03

wilsonbiggs
Scratcher
Registered: 2011-10-08
Posts: 71

Variables connected to broadcasts

This doesn't look possible. I'm trying to make sure that when I open an application in my OS it won't open in another person's OS.

when clicked
set [broadcasting v] to [1]
broadcast [credits v]
set [broadcasting v] to [0]
and


when I receive [credits v]
if <(broadcasting) = [1]>
go to x: (0) y: (0)
show
end
How can I get this to work?

Last edited by wilsonbiggs (2012-02-03 22:04:58)


http://i196.photobucket.com/albums/aa122/wilsonbiggs/Screenshot2012-02-04at11552PM.pnghttp://dragcave.net/image/S0uKJ.gifhttp://dragcave.net/image/bQId9.gif

Offline

 

#2 2012-02-03 21:23:15

wilsonbiggs
Scratcher
Registered: 2011-10-08
Posts: 71

Re: Variables connected to broadcasts

BUMP

Please I need help!


http://i196.photobucket.com/albums/aa122/wilsonbiggs/Screenshot2012-02-04at11552PM.pnghttp://dragcave.net/image/S0uKJ.gifhttp://dragcave.net/image/bQId9.gif

Offline

 

#3 2012-02-03 22:36:58

CheeseMunchy
Scratcher
Registered: 2008-10-13
Posts: 1000+

Re: Variables connected to broadcasts

What do you need help with exactly?


6418,

Offline

 

#4 2012-02-03 22:40:08

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Variables connected to broadcasts

It could be that it broadcasts "credits", and then changes broadcasting back to zero, before credits has a chance to run.  Try using the "broadcast [credits] and wait" block.  If the code in your last script is more complex than "go to x() y() and show" (and takes too much time), you could do this:

when I receive [credits v]
if <(broadcasting) = [1]>
broadcast [do credits stuff]
end
That way, the broadcast is activated, and "broadcasting" is set back to zero as quickly as possible.

Last edited by MoreGamesNow (2012-02-03 22:40:19)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-02-04 07:02:45

wilsonbiggs
Scratcher
Registered: 2011-10-08
Posts: 71

Re: Variables connected to broadcasts

MoreGamesNow wrote:

It could be that it broadcasts "credits", and then changes broadcasting back to zero, before credits has a chance to run.  Try using the "broadcast [credits] and wait" block.  If the code in your last script is more complex than "go to x() y() and show" (and takes too much time), you could do this:

when I receive [credits v]
if <(broadcasting) = [1]>
broadcast [do credits stuff]
end
That way, the broadcast is activated, and "broadcasting" is set back to zero as quickly as possible.

Thanks, your first suggestion worked. The second one would still cause problems.


http://i196.photobucket.com/albums/aa122/wilsonbiggs/Screenshot2012-02-04at11552PM.pnghttp://dragcave.net/image/S0uKJ.gifhttp://dragcave.net/image/bQId9.gif

Offline

 

Board footer