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

#1 2012-11-25 12:36:04

MissPacGirl
New Scratcher
Registered: 2012-11-07
Posts: 2

My Background will not switch!

The game is called Variety 1.2. I am working on it but the background does not work. Please look at my script... Ive been working on this for over 24 hours and I can not figure it out. The background to change into background6 does not work when I press "y". Instead my game get confused with the previous scripts... I have no clue of how to fix it.


Thank you for reading! If you figure this out I will love you as much as I love unicorns and butterflies.

Offline

 

#2 2012-11-25 13:43:50

curiouscrab
Scratcher
Registered: 2012-06-25
Posts: 100+

Re: My Background will not switch!

I don't see any problem in the program you have. The background switches fine for me.


http://i50.tinypic.com/dopbtw.png

Offline

 

#3 2012-11-25 14:24:41

tree-hugger
Scratcher
Registered: 2011-11-19
Posts: 38

Re: My Background will not switch!

I looked at your script and I figured out what was wrong. When the key Y is pressed the background takes its command and switches to background6, but the background is also receiving the command to switch to background5 because it still hears the "Ask Alien" broadcast so it stays on background5. Hopefully that makes a little sense... anyway heres how you fix the problem:

In your astronaut sprite you have this script:

when gf clicked
forever if <(Space Tokens) = [14]>
  broadcast [Ask Alien v]
  hide
end
The problem with this is your astronaut is broadcasting "Ask Alien" forever. That means your background is receiving the command to switch to background5 forever so it can't switch backgrounds when y is pressed. Heres how to fix that.

when gf clicked
if <(Space Tokens) = [14]>
  broadcast [Ask Alien v]
  hide
end
Now the astronaut will only broadcast the "Ask Alien" command once. It will switch to background5 then when y is pressed it will switch to background6. I hope that was helpful  smile


http://oi48.tinypic.com/1y7tjr.jpghttp://oi50.tinypic.com/28tb34j.jpg                     http://oi50.tinypic.com/21c6v74.jpg                    ...ya, I'm weird... REAL weird...
BITBOT ALL THE WAY!!!     Only the WEIRDEST games!     (that's just  a Tree-Hugger thing)

Offline

 

#4 2012-11-25 16:38:56

MissPacGirl
New Scratcher
Registered: 2012-11-07
Posts: 2

Re: My Background will not switch!

Treehugger, if I use your techinque the game does not respond when I get up to 14 points in my game. It just stops. Thanks for trying though...  smile

Offline

 

#5 2012-11-26 00:03:30

tree-hugger
Scratcher
Registered: 2011-11-19
Posts: 38

Re: My Background will not switch!

Oh whoops, I'm not giving up yet! I made a simple mistake here try this script - I tested it this time  wink

when gf clicked
wait until <(Space Tokens) = [14]>
if <(Space Tokens) = [14]>
  broadcast [Ask Alien v]
  hide
end
Bear with me here... this should work  smile

Last edited by tree-hugger (2012-11-26 00:04:45)


http://oi48.tinypic.com/1y7tjr.jpghttp://oi50.tinypic.com/28tb34j.jpg                     http://oi50.tinypic.com/21c6v74.jpg                    ...ya, I'm weird... REAL weird...
BITBOT ALL THE WAY!!!     Only the WEIRDEST games!     (that's just  a Tree-Hugger thing)

Offline

 

Board footer