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

#1 2007-10-07 11:33:40

Sniperzero
Scratcher
Registered: 2007-10-04
Posts: 3

How do i do scrolling backgrounds???

i need help with doing scrolling backgrounds.

Offline

 

#2 2007-10-07 12:05:41

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: How do i do scrolling backgrounds???

Try using "Forum Search" (at the top of this page) to search for
   scrolling background

The topic has come up several times and a number of people have put up demo projects to show how to do it.

Offline

 

#3 2007-10-07 12:22:24

bigB
Scratcher
Registered: 2007-06-09
Posts: 100+

Re: How do i do scrolling backgrounds???

here is a useful forum topic for you.
http://scratch.mit.edu/forums/viewtopic.php?id=1629


http://scratch.mit.edu/projects/bigB/260981 Draw to Text
http://scratch.mit.edu/projects/bigB/181829 3D Stunt Flyer

Offline

 

#4 2007-10-07 14:42:12

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: How do i do scrolling backgrounds???

Scrolling backgrounds is one of the harder things you can attempt in scratch so you should already be good at programming before trying scrolling.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#5 2007-10-08 01:00:37

JoelP
Scratcher
Registered: 2007-07-20
Posts: 100+

Re: How do i do scrolling backgrounds???

For scrolling you need these things
---sprites---
9 sprites that are the size of the screen, NW, W, SW, N, centre, S, NE, E and SE
---variables---
Scroll x
Scroll y

Now for each variable do these following things, imagine you have a 9-tile system.
NW-
<when green flag clicked>
<forever>
<set x to( scroll x + 480
<set y to( scroll y + 360
W-
<when green flag clicked>
<forever>
<set x to( scroll x + 480
<set y to( scroll y + 0
SW-
<when green flag clicked>
<forever>
<set x to( scroll x + 480
<set y to( scroll y + -360
N-
<when green flag clicked>
<forever>
<set x to( scroll x + o
<set y to( scroll y + -360
Centre-
<when green flag clicked>
<forever>
<set x to( scroll x + o
<set y to( scroll y + 0
S-
<when green flag clicked>
<forever>
<set x to( scroll x + o
<set y to( scroll y + -360
NE-
<when green flag clicked>
<forever>
<set x to( scroll x + 480
<set y to( scroll y + 360
E-
<when green flag clicked>
<forever>
<set x to( scroll x + 480
<set y to( scroll y + 0
SE-
<when green flag clicked>
<forever>
<set x to( scroll x + 480
<set y to( scroll y + -360

And then for the background
<when green flag clicked>
<forever>
<if> <key[ up arrow ]pressed?>
<change{ scroll y }by( -1
<if> <key[ down arrow ]pressed?>
<change{ scroll y }by( 1
<if> <key[ right arrow ]pressed?>
<change{ scroll x }by( -1
<if> <key[ left arrow ]pressed?>
<change{ scroll x }by( 1

thats all, it's actually pretty simple, not variable mania.
there you go, the infinate scrolling is another story, so I won't get into that, but using the tip that I gave you, you might get the idea.

Last edited by JoelP (2007-10-08 01:02:47)


do you want to see  real 3D ? come here and have a 3D runaround. the game will soon be a fighting game, as you can see when you press space   http://scratch.mit.edu/projects/JoelP/33274

Offline

 

#6 2007-10-12 02:45:20

JoelP
Scratcher
Registered: 2007-07-20
Posts: 100+

Re: How do i do scrolling backgrounds???

read it yet?


do you want to see  real 3D ? come here and have a 3D runaround. the game will soon be a fighting game, as you can see when you press space   http://scratch.mit.edu/projects/JoelP/33274

Offline

 

#7 2007-10-28 13:38:13

Sniperzero
Scratcher
Registered: 2007-10-04
Posts: 3

Re: How do i do scrolling backgrounds???

yeah, thanx for your help:)

Offline

 

#8 2008-05-26 14:08:07

rbtman1
Scratcher
Registered: 2008-05-26
Posts: 2

Re: How do i do scrolling backgrounds???

you should make 2 background sprites that have (go to back) in the scripts. make it so that they move and alternate along with scrollX (or whatever)

Offline

 

Board footer