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

#1 2008-02-22 13:22:10

bj2007
Scratcher
Registered: 2008-02-05
Posts: 2

Background Changes

How do I make the background change then when it changes have a certain sprite not appear?

P.S. I know how to make the background change. That is not my question.

Offline

 

#2 2008-02-22 14:20:24

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Background Changes

Post this script in the stage:

Code:

...
Switch to background (background 2)
broadcast [ The background has changed! ]

So, when the background changes, a broadcast will be send immediately. Now we have to program a script that hides the sprite when the broadcast is sended.

Put this in the script panel of the sprite(s) that have to dissapear:

Code:

When I receive [The background has changed!]
hide

If this is not what you mean, please be a little more clear and I will try to help again  big_smile


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#3 2008-02-22 14:33:21

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: Background Changes

Alternatively, on the sprite, in a loop of some kind:

if (costume) of (stage) = 2
> hide


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#4 2008-02-23 06:53:45

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Background Changes

Remember to put a short wait or, a stop script if you only need it once, elsewhere it will slow down you project heavily.


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#5 2008-02-23 10:36:29

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Background Changes

If you only need to do something once, you are better off with

   wait until <condition>

than using any sort of loop.

Offline

 

#6 2008-02-28 18:09:22

bj2007
Scratcher
Registered: 2008-02-05
Posts: 2

Re: Background Changes

thanks guys JSO hit it dead on. This helps alot!

Offline

 

Board footer