Discuss Scratch

TheReptileGirl
Scratcher
4 posts

How do i change the backdrop when my variable reaches a certain number.

I need a little help.
Im making a frog chase game, and im adding levels.
I have tried recomended ways but none work.
can someone help me out?
I have tried looking it up but i got no luck, and its bothering me, because im very stubborn, and when i cant get something to be a perfect way i get upset VERY easily. Thanks for your consideration ]
awesome-llama
Scratcher
1000+ posts

How do i change the backdrop when my variable reaches a certain number.

when [variable v] > (10)
switch backdrop to [example backdrop v]
It can be as simple as that, Edit: It turns out this does not work. Use the below.

[…] but the way this is scripted depends on its use case. If you only wanted it to be triggered once, try:
when green flag clicked
wait until <(variable) > [10]>
switch backdrop to [example backdrop v]

Last edited by awesome-llama (Feb. 20, 2020 12:49:51)



TheReptileGirl
Scratcher
4 posts

How do i change the backdrop when my variable reaches a certain number.

awesome-llama wrote:

when [variable v] > (10)
switch backdrop to [example backdrop v]
It can be as simple as that, but the way this is scripted depends on its use case. If you only wanted it to be triggered once, try:
when green flag clicked
wait until <(variable) > [10]>
switch backdrop to [example backdrop v]

thanks
TheReptileGirl
Scratcher
4 posts

How do i change the backdrop when my variable reaches a certain number.

awesome-llama wrote:

when [variable v] > (10)
switch backdrop to [example backdrop v]
It can be as simple as that, but the way this is scripted depends on its use case. If you only wanted it to be triggered once, try:
when green flag clicked
wait until <(variable) > [10]>
switch backdrop to [example backdrop v]
it didnt work just now
awesome-llama
Scratcher
1000+ posts

How do i change the backdrop when my variable reaches a certain number.

TheReptileGirl wrote:

awesome-llama wrote:

when [variable v] > (10)
switch backdrop to [example backdrop v]
It can be as simple as that, but the way this is scripted depends on its use case. If you only wanted it to be triggered once, try:
when green flag clicked
wait until <(variable) > [10]>
switch backdrop to [example backdrop v]
it didnt work just now
Can you share the scripts of your project or give a link? it would be much easier for me to find the issues and help you.

Last edited by awesome-llama (Jan. 27, 2019 05:29:17)



qqqwwweeerrrtttt1
Scratcher
3 posts

How do i change the backdrop when my variable reaches a certain number.

if its in a forever/repeat then it could stop your script.
instead try this:
forever
if <[var] > [10]> then
switch backdrop to [ 2]

end
end
deck26
Scratcher
1000+ posts

How do i change the backdrop when my variable reaches a certain number.

qqqwwweeerrrtttt1 wrote:

if its in a forever/repeat then it could stop your script.
instead try this:
forever
if <[var] > [10]> then
switch backdrop to [ 2]

end
end
Avoid switching backdrops repeatedly in a loop unnecessarily though. Better to use wait untils if you want it to happen more than once.

forever
wait until <<(var) > [10]> and <not <(backdrop #) = [2]>>
switch backdrop to [ 2]
end

Last edited by deck26 (Jan. 27, 2019 13:32:55)

amster11722
Scratcher
100+ posts

How do i change the backdrop when my variable reaches a certain number.

Orrrrrr this:

forever
if <<(var) > [10]> and <(var) < [12]>> then
switch costume to [costume 2 v]
else
switch costume to [costume 1 v]
end
end

Last edited by amster11722 (Jan. 27, 2019 13:44:57)


when gf clicked
broadcast[WAKE UP!!! v]
when i receive [WAKE UP!!! v]
switch costume to[clothes v]
go to x: [https://scratch.mit.edu/discuss/] y: [Help With Scripts]
Topaz_Genie
New to Scratch
1 post

How do i change the backdrop when my variable reaches a certain number.

awesome-llama wrote:

when [variable v] > (10)
switch backdrop to [example backdrop v]
It can be as simple as that, but the way this is scripted depends on its use case. If you only wanted it to be triggered once, try:
when green flag clicked
wait until <(variable) > [10]>
switch backdrop to [example backdrop v]


doesn't work?
the ‘when variable > 10’ block doesn't exist?

Last edited by Topaz_Genie (Feb. 20, 2020 12:15:04)

awesome-llama
Scratcher
1000+ posts

How do i change the backdrop when my variable reaches a certain number.

Topaz_Genie wrote:

awesome-llama wrote:

when [variable v] > (10)
switch backdrop to [example backdrop v]
It can be as simple as that, but the way this is scripted depends on its use case. If you only wanted it to be triggered once, try:
when green flag clicked
wait until <(variable) > [10]>
switch backdrop to [example backdrop v]


doesn't work?
the ‘when variable > 10’ block doesn't exist?
I just checked, and it does but not in the way I put it. I made a mistake and thought that variables could go into there. Just use the script below it.

I will edit the other posts to fix the error.

Edit: Maybe hacked blocks or previous versions of scratch could do something similar with that block. I don't know for sure, though.

Last edited by awesome-llama (Feb. 20, 2020 12:51:08)



fghdjsb
Scratcher
7 posts

How do i change the backdrop when my variable reaches a certain number.

hey llama your codes dont work
GreysonTheChickenxD
Scratcher
1 post

How do i change the backdrop when my variable reaches a certain number.

good job
DerpyHead0
Scratcher
1000+ posts

How do i change the backdrop when my variable reaches a certain number.

GreysonTheChickenxD wrote:

good job
please don't necropost, this thread is more than a year old and you haven't said anything relevant.

when I start as a clone
delete this clone
Qs_C23
Scratcher
1 post

How do i change the backdrop when my variable reaches a certain number.

Thank you llama, I put your name in the credits of my game check it out: https://scratch.mit.edu/projects/486306778/
SaravanaNaveen
Scratcher
3 posts

How do i change the backdrop when my variable reaches a certain number.

Me Too

SaravanaNaveen
Scratcher
3 posts

How do i change the backdrop when my variable reaches a certain number.

Pls Give and Idea
SaravanaNaveen
Scratcher
3 posts

How do i change the backdrop when my variable reaches a certain number.

How Do You Even Get Variable Option Cause Am Not Getting It…………
amazingscratchcoder
Scratcher
100+ posts

How do i change the backdrop when my variable reaches a certain number.

And This is what you call necroposting

https://scratch.mit.edu/discuss/topic/607671/ - We're a group of passionate musicians who'd like to share our music with others. Want original, personalized, diverse music, and really fast? Order now at the Piano Shop!

Powered by DjangoBB