Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do you make a backdrop change after a sprite says something.
- prsrk
- Scratcher
3 posts
How do you make a backdrop change after a sprite says something.
I am doing a project for school and my school wants me to change the level by changing the backdrop after the sprite touches the button and broadcasts the message. There are so many easier ways of doing this.
Please help.
Please help.
- bbciplayer
- Scratcher
500+ posts
How do you make a backdrop change after a sprite says something.
Try this script:
when green flag clicked
forever
if <touching [Sprite Goes Here v] ?> then
say [Your Message Here] for (2) secs
switch backdrop to [The Backdrop You Want v]
end
end
i am mostly inactive on this site but still check in ocassionally!
11 years of scratching <3
- DrZomgaming
- Scratcher
10 posts
How do you make a backdrop change after a sprite says something.
when green flag clicked
forever
if <touching [button] ?> then
say [lol nice] for (2) seconds
go to [beginning of level]
broadcast [nextlevel]
end
end
while the backdrop has this
when I receive [nextlevel]
next backdrop
when I start as a clone
join the dark side of the force::#000000
switch costume to [stormtrooper]
forever
if <touching [lightsaber]?> then
delete this clone
end
- --Zach--
- Scratcher
19 posts
How do you make a backdrop change after a sprite says something.
The message script.
Then for the backdrop changing script.
when green flag clicked
forever
if <touching [Name of Button Sprite v] ?> then
wait until <touching [Name of Button Sprite v] ?>
say [text here] for (2) secs
broadcast [message v]
end
end
Then for the backdrop changing script.
when I receive [message v]There ya go.
switch backdrop to [backdrop v]
Last edited by --Zach-- (June 19, 2018 15:29:39)
Hey there! I'm –Zach–.
I love cats and coding!
- deck26
- Scratcher
1000+ posts
How do you make a backdrop change after a sprite says something.
But be careful or the forever loop will trigger the broadcast again. Perhaps use a wait until not touching button sprite. The message script.when green flag clicked
forever
if <touching [Name of Button Sprite v] ?> then
say [text here] for (2) secs
broadcast [message v]
end
end
Then for the backdrop changing script.when I receive [message v]There ya go.
switch backdrop to [backdrop v]
- --Zach--
- Scratcher
19 posts
How do you make a backdrop change after a sprite says something.
Oops, lemme fix thatBut be careful or the forever loop will trigger the broadcast again. Perhaps use a wait until not touching button sprite. The message script.when green flag clicked
forever
if <touching [Name of Button Sprite v] ?> then
say [text here] for (2) secs
broadcast [message v]
end
end
Then for the backdrop changing script.when I receive [message v]There ya go.
switch backdrop to [backdrop v]
Hey there! I'm –Zach–.
I love cats and coding!
- Discussion Forums
- » Help with Scripts
- » How do you make a backdrop change after a sprite says something.