Discuss Scratch

Gamergalaxy689
Scratcher
100+ posts

how do I make the objects detect what room they're in, and appear/disappear accordingly?

https://scratch.mit.edu/projects/800359448/editor/

in this game, I need to make another room (on the right side of the starter room). the thing is, all the objects from the starting room are still in the next room. I want them to disappear when if
<not <(rooms) = [your office]>>
and appear if
<(rooms) = [your office]>
how do I manage this?
ProjectRayfield
New Scratcher
7 posts

how do I make the objects detect what room they're in, and appear/disappear accordingly?

Gamergalaxy689 wrote:

https://scratch.mit.edu/projects/800359448/editor/

in this game, I need to make another room (on the right side of the starter room). the thing is, all the objects from the starting room are still in the next room. I want them to disappear when if
<not <(rooms) = [your office]>>
and appear if
<(rooms) = [your office]>
how do I manage this?
when green flag clicked
forever
if <(backdrop #) = [1]> then
show
end
if <(backdrop #) = [2]> then
hide
end
end

Hope this helps!
Sboosh_Kaboosh
Scratcher
100+ posts

how do I make the objects detect what room they're in, and appear/disappear accordingly?

when green flag clicked
forever
if <(rooms) = [your office]> then
show
else
hide
end
end

This should work!
Gamergalaxy689
Scratcher
100+ posts

how do I make the objects detect what room they're in, and appear/disappear accordingly?

the thing is, there's a desk that blows up and hides itself. with that script, it would still show itself even though it' supposed to be gone.
thanks for the advice (it works for 99% of the objects!)
medians
Scratcher
1000+ posts

how do I make the objects detect what room they're in, and appear/disappear accordingly?

Gamergalaxy689 wrote:

the thing is, there's a desk that blows up and hides itself. with that script, it would still show itself even though it' supposed to be gone.
thanks for the advice (it works for 99% of the objects!)
Then you could just do this:
mmhmBeans
Scratcher
500+ posts

how do I make the objects detect what room they're in, and appear/disappear accordingly?

medians wrote:

Gamergalaxy689 wrote:

the thing is, there's a desk that blows up and hides itself. with that script, it would still show itself even though it' supposed to be gone.
thanks for the advice (it works for 99% of the objects!)
Then you could just do this:
snip
It uses an extra variable. You can make a blank costume and switch to it after the table explodes. Or you could put “hide” and then “stop this script”.
medians
Scratcher
1000+ posts

how do I make the objects detect what room they're in, and appear/disappear accordingly?

mmhmBeans wrote:

medians wrote:

Gamergalaxy689 wrote:

the thing is, there's a desk that blows up and hides itself. with that script, it would still show itself even though it' supposed to be gone.
thanks for the advice (it works for 99% of the objects!)
Then you could just do this:
snip
It uses an extra variable. You can make a blank costume and switch to it after the table explodes. Or you could put “hide” and then “stop this script”.
That too. Though at least it isn’t as bad as that one project..

Powered by DjangoBB