Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Background doesn't change when using the change background block
- very_coolio
-
New Scratcher
2 posts
Background doesn't change when using the change background block
Hi. I'm trying to add a lose and win screen to my game, but when I added the script the background gets stuck at the “lose” screen unless I put a forever set to “win/guess” background script. I've looked over my code and nothing seems to be wrong. Any help is appreciated.
Thanks!
Game: https://scratch.mit.edu/projects/695748068/
Thanks!
Game: https://scratch.mit.edu/projects/695748068/
- legendary34678
-
Scratcher
1000+ posts
Background doesn't change when using the change background block
The problem seems to lie in the three cup sprites which each have a forever loop changing the backdrop to “lose” if the mouse is down, it's touching the mouse, and the random number matches it. Try changing that to only checking if the cup was the correct one when the sprite is clicked. So, you would use the “when sprite clicked” block rather than a forever loop with “when mouse down? and touching mouse pointer”. Feel free to ask me to clarify!
I hope this helps!
I hope this helps!
- very_coolio
-
New Scratcher
2 posts
Background doesn't change when using the change background block
Thank you!
- Discussion Forums
- » Help with Scripts
-
» Background doesn't change when using the change background block