How do I change a background when I'm on a different sprite? ITstead of having to broadcast something to tell the background to change...? Please someone help!!!
Funky Studios
Last edited by FunkyStudios (2007-07-10 13:47:15)
Offline
HELLLLLLPPPPPPPP
Offline
.... Check the topic Here!
Offline
You have to use a broadcast to tell the background to change from inside of a sprite.
Paulmedwal
Offline
Actually, you can use a vairable to switch backgrounds. You put in a sprite| set () to| or |change () by ( ) | and then in the background sprite there can be| forever if (vairable)= ( ) switch to background
Last edited by Greatdane (2007-07-15 10:13:14)
Offline
Global variables and busy-wait loops can be used in place of messages, but the message mechanism is somewhat cleaner and should be more efficient if implemented correctly. Also, the message mechanism does not require the green flag to start everything off.
I've been trying in my programs to minimize the need for green flag scripts, so that programs work correctly even if people don't hit the green flag button first. This is not possible in all programs, but is an interesting programming challenge.
Offline
Could you explain how to change the background with a different sprite step by step?
Offline
nkc wrote:
i need help how to change back grounds use the picture things and please help!!!!!!!!!!!
Hey nkc,
You change the background with the "Switch To Background xxx" block which you will find in the Stage area under Looks (purple blocks). If you want to set it up so that the background changes when something happens to a sprite somewhere, the easiest way to do it is with Broadcast messages.
Set up a script on the stage that looks like this:
When I receive some-name-you-pick Switch to Background another-name-you-pick
Then, whenever you want the background to change, you send a broadcast message from a script anywhere in the project:
Broadcast some-name-you-pick
You will find the "When I receive" and the "Broadcast" blocks in the Control section (gold blocks). You make up a name for the broadcast message. I hope that helps. If you would like a sample project, just let me know.
Offline