Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do you make a scrolling background?
- helloworldbyeworld
-
Scratcher
1000+ posts
How do you make a scrolling background?
Hi,
I want to know how to make a scrolling background. When I try to make the background go past the edge (by using something like set x to 1000), it just sticks to the edge closest to the intended position. How do you make a background that scrolls?
Thanks!
I want to know how to make a scrolling background. When I try to make the background go past the edge (by using something like set x to 1000), it just sticks to the edge closest to the intended position. How do you make a background that scrolls?
Thanks!
- MasterofTheBrick
-
Scratcher
1000+ posts
How do you make a scrolling background?
When in doubt, always refer to the Scratch Wiki.
- Chocolate_Melons
-
Scratcher
36 posts
How do you make a scrolling background?
What you can do is have a sprite with the background that you want to have scrolling and then have the following code inside of it:
when green flag clicked
go to x: (0) y: (0)
create clone of [myself]
forever
change x by (-1)
if <(x position) < [-460]> then
set x to (480)
end
end
when I start as a clone
go to x: (480) y: (0)
forever
change x by (-1)
if <(x position) < [-460]> then
set x to (480)
end
end
- Binary-Logic
-
Scratcher
100+ posts
How do you make a scrolling background?
@griffpatch recently made a scrolling background tutorial on YouTube. See if that helps.
- deck26
-
Scratcher
1000+ posts
How do you make a scrolling background?
Scratch normally wants to have at least part of a sprite showing on screen - if the x position means it is fully off-screen it will adjust it. You can get round that by selecting a larger costume before positioning the sprite and then selecting the desired costume.
- Discussion Forums
- » Help with Scripts
-
» How do you make a scrolling background?