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

#1 2012-06-29 17:09:00

Hariex
New Scratcher
Registered: 2012-06-25
Posts: 10

Help Needed Again...

I am wondering whether it is possible to say, "If the background is (insert background here,) then do (insert action here.)

Any help?

Offline

 

#2 2012-06-29 17:14:26

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Help Needed Again...

Yup! There's a script where you can do:

when gf clicked
forever if <(background #) = [numberHere] >
  do whatever you want here
end


Hai.

Offline

 

#3 2012-06-29 17:22:37

Hariex
New Scratcher
Registered: 2012-06-25
Posts: 10

Re: Help Needed Again...

It doesn't seem to work for me... Do you know why?

Offline

 

#4 2012-06-29 20:12:49

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Help Needed Again...

fg123 wrote:

Yup! There's a script where you can do:

when gf clicked
forever
if <(background #) = [numberHere] >
  do whatever you want here
end
end

fixed.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

#5 2012-06-30 04:08:44

Hariex
New Scratcher
Registered: 2012-06-25
Posts: 10

Re: Help Needed Again...

Ahh! Why is it not working?

Offline

 

#6 2012-06-30 05:26:59

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Help Needed Again...

Hariex wrote:

Ahh! Why is it not working?

if <(background #) = [1]>
 bla
end
Should work just fine.

Remember, it needs to be a number. For example, you have these backgrounds:

background1
background2
stageinator

Now, you want something to happen if the background is background2. It's your 2nd background, so...

if <(background #) = [2]>
 bla
end
will work.

Last edited by SciTecCf (2012-06-30 05:27:12)


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#7 2012-06-30 13:19:42

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Help Needed Again...

Firedrake969 wrote:

fg123 wrote:

Yup! There's a script where you can do:

when gf clicked
forever
if <(background #) = [numberHere] >
  do whatever you want here
end
end

fixed.

My example works too, just that the OP would have a more simplified code.


Hai.

Offline

 

#8 2012-06-30 13:54:54

Firedrake969
Scratcher
Registered: 2011-11-24
Posts: 1000+

Re: Help Needed Again...

Except he can put in more code between the Forever and the If.


Click the sign.
https://s3.amazonaws.com/eterna/eterna2/logo2.png

Offline

 

Board footer