Discuss Scratch

Student_Of_The_Year
Scratcher
2 posts

When my sprite touches an edge change background?

I'm trying to find out how to change the background when a sprite touches the edge of the background
TechPandaPro
Scratcher
99 posts

When my sprite touches an edge change background?

There is a “touching edge” Sensing block that you could use for this.
when green flag clicked
wait until <touching [edge v] ?>
switch backdrop to [whichever backdrop v]

Hope this helps!
TechPandaPro
latin_gamerX
Scratcher
500+ posts

When my sprite touches an edge change background?

if <(240) < (x position)> then
next backdrop
set x to (-200)
end

this post has been ninjaed and the first was a better script so

Last edited by latin_gamerX (Oct. 10, 2020 20:55:25)

help_with_scripts
Scratcher
100+ posts

When my sprite touches an edge change background?

TechPandaPro wrote:

There is a “touching edge” Sensing block that you could use for this.
when green flag clicked
wait until <touching [edge v] ?>
switch backdrop to [whichever backdrop v]

Hope this helps!
TechPandaPro
You need a forever loop
help_with_scripts
Scratcher
100+ posts

When my sprite touches an edge change background?

Student_Of_The_Year wrote:

I'm trying to find out how to change the background when a sprite touches the edge of the background
You can use:
when green flag clicked
forever
if <> then
<touching [ edge ] ?>
next backdrop
end
end
help_with_scripts
Scratcher
100+ posts

When my sprite touches an edge change background?

help_with_scripts wrote:

Student_Of_The_Year wrote:

I'm trying to find out how to change the background when a sprite touches the edge of the background
You can use:
when green flag clicked
forever
if <> then
<touching [ edge ] ?>
next backdrop
end
end
Oops, they got a little messed up, I have never used blocks before! Put the touching edge block in the if block input, and put the next backdrop block inside of the if block.
lisagu
Scratcher
79 posts

When my sprite touches an edge change background?

Student_Of_The_Year wrote:

I'm trying to find out how to change the background when a sprite touches the edge of the background

when green flag clicked
forever
if <touching [ edge] ?> then
next backdrop

end
end

Hope it helps!
deck26
Scratcher
1000+ posts

When my sprite touches an edge change background?

lisagu wrote:

Student_Of_The_Year wrote:

I'm trying to find out how to change the background when a sprite touches the edge of the background

when green flag clicked
forever
if <touching [ edge] ?> then
next backdrop

end
end

Hope it helps!
But add a wait until not touchng edge or it will quickly loop through multiple backdrops.

Powered by DjangoBB