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

#1 2009-12-13 10:57:55

Dogcake
Scratcher
Registered: 2009-12-02
Posts: 4

Scrolling, help needed.

Hello

I have made my background scrolling at the moment and I am trying to make it repeat back to the first background image after the last one but I am not sure how this could be done with the scripts I have.

The blocks used in 'Stage'
http://i80.photobucket.com/albums/j175/nonoon/Scrolling1.jpg

The blocks used for each Background image. (Each image has a different x position and globalx)
http://i80.photobucket.com/albums/j175/nonoon/Scrolling2.jpg

Another problem I am having is during the scrolling is when the images scroll to a certain point they dissapear. Like when half way through my second background sprite the first one dissapears and half way through the third ,the second dissapears. Would I have to draw longer images?

Any help would be greatly appreaciated. Thanks for your time.

Offline

 

#2 2009-12-13 11:36:21

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Scrolling, help needed.

I think you are doing something wrong. Most scrollers are built like this:

Scroller guy:
http://www.imagebeast.net/images/gghuysom6niuyhgemqtt.gif

Platform:
http://www.imagebeast.net/images/ysh1o0g8t4i2lzgc710.gif


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#3 2009-12-16 17:16:43

Dogcake
Scratcher
Registered: 2009-12-02
Posts: 4

Re: Scrolling, help needed.

Hello

What I am trying to do is have my background automatically scroll forward and will continuosly loop, instead of using arrow keys.

Thanks for the help.

Last edited by Dogcake (2009-12-16 17:17:07)

Offline

 

#4 2009-12-16 18:29:07

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Scrolling, help needed.

That's complicated. Can you explain in more detail?  smile


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#5 2009-12-16 18:34:21

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Scrolling, help needed.

Oh, now I get what you mean.  tongue

Scroller guy:
http://www.imagebeast.net/images/gi938y6qq2wi3hiozwm.gif

Platform:
http://www.imagebeast.net/images/ysh1o0g8t4i2lzgc710.gif


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#6 2009-12-17 23:43:34

RyanBenLee
Scratcher
Registered: 2009-03-08
Posts: 47

Re: Scrolling, help needed.

I know! I learnt from Dream-Caster!

First sprite(not refering to sprites below):
<when green flag clicked><forever><change{scrollx  }by( -1

Moving Background sprite1
<when green flag clicked><forever><set x to((<{ scrollx }>  <+> (( 480 <*> 0 )) ))

Moving Background sprite2
<when green flag clicked><forever><set x to((<{ scrollx }>  <+> (( 480 <*> 1 )) ))
<if><( <x position> <>> 0 )><set{scrollx  }to( 0



Hope this helps.

Offline

 

#7 2010-01-02 17:03:21

mrak
Scratcher
Registered: 2009-11-22
Posts: 30

Re: Scrolling, help needed.

<change{  }by( <set{  }to( <{  }> i am testing

Offline

 

#8 2010-04-12 08:45:48

RyanBenLee
Scratcher
Registered: 2009-03-08
Posts: 47

Re: Scrolling, help needed.

I dont know how scrollers work but i suggest if you dont care about understanding just go to a good scrolling game and just change the sprites. im doing that!:-)

Offline

 

Board footer