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

#1 2012-04-15 14:46:42

lv_aivlem
New Scratcher
Registered: 2012-04-15
Posts: 2

Backgrounds help

I'm creating a game, and want to change the background when the user "wins".  I can't write it into the Sprite's script, because there isn't a change background block.  I put it into the background script, but it doesn't seem to be registering appropriately.  Any suggestions?

I also need to hide the sprite when it's on the first background and third background.  I've figured out how to hide it at the end of the game, but not on the first background (which is directions, etc).

Thanks in advance!!

Offline

 

#2 2012-04-15 14:55:51

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Backgrounds help

When the user wins, use this block:

broadcast [win  v]
Then put this in the stage:
When I receive [win  v]
switch to background [something  v]
Also, for hiding the sprite:
when gf clicked
forever 
if < <([background #  v] of [Stage  v]) = [1]> or <([background #  v] of [Stage  v]) = [3]> >
hide
else
show
end

Last edited by Greenatic (2012-04-15 14:56:09)

Offline

 

#3 2012-04-15 16:56:34

lv_aivlem
New Scratcher
Registered: 2012-04-15
Posts: 2

Re: Backgrounds help

Thank you!  It worked beautifully!

Offline

 

#4 2012-04-15 17:01:09

Greenatic
Scratcher
Registered: 2009-05-03
Posts: 1000+

Re: Backgrounds help

lv_aivlem wrote:

Thank you!  It worked beautifully!

No problem! Glad I could help!   big_smile

Offline

 

Board footer