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

#1 2007-12-10 14:01:36

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Scrolling help - again!

Hi, my previous post asked how to do scrolling, and I must say it was very usefull. However being the pushing person I am I wanted better. So I posting today asking if someone could explain to me how to do infinite scrolling, by that I mean you never see blank it just goes back to your first background.

All help apreciated,
Messd002.


Burn baby Burn!

Offline

 

#2 2007-12-10 14:38:21

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: Scrolling help - again!

ummm, help?


Burn baby Burn!

Offline

 

#3 2007-12-10 16:16:24

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

Re: Scrolling help - again!

Just use if statements that change the values of the scroll variables. You should try experimenting a bit.

Basically what I think you want is so that when the scroll variable reaches a certain value it is reset.


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

 

#4 2007-12-11 12:15:12

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: Scrolling help - again!

Yeah, thats kinda what I want. I would love to know how to do as it would add a whole new region to my games.

Last edited by messd002 (2007-12-11 12:25:34)


Burn baby Burn!

Offline

 

#5 2007-12-11 13:14:34

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

Re: Scrolling help - again!

Try something like

if scrollX>1000
set scrollX to 0


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

 

#6 2007-12-11 18:19:15

SimpleScratch
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: Scrolling help - again!

OR use the mod block
i.e if each sprite is 460 wide and you are using 3 of them - instead of reffering to ScrollX in Archimage's examples - try using somthing like ScrollX mod 1380  (1380= 460*3).

I've not tried it out but it could give useful results :-)

regards

Simon

Offline

 

#7 2007-12-12 15:40:30

Gigabyte123
Scratcher
Registered: 2007-10-15
Posts: 100

Re: Scrolling help - again!

if you wanted something to keep record of... how many metres you have gone for example, you make a variable that keeps record of how many resets there have been, and then make another variable for distance travelled, and set it to scroll x + 1000 (scroll limit)*resets.


gather your confidence- reach for the skies... and always use deoderant!

Offline

 

#8 2007-12-12 15:44:46

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: Scrolling help - again!

Thanks, I'll have a go soon.


Burn baby Burn!

Offline

 

#9 2007-12-13 15:34:16

messd002
Scratcher
Registered: 2007-12-07
Posts: 100+

Re: Scrolling help - again!

Thanks guys I have made a succeful infinite scrolling background. The url if you want to use it is:

http://scratch.mit.edu/projects/messd002/66643

Last edited by messd002 (2007-12-13 15:38:57)


Burn baby Burn!

Offline

 

#10 2008-05-09 23:34:51

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Scrolling help - again!

archmage wrote:

Try something like

if scrollX>1000
set scrollX to 0

No Archmage, it's <1000. You use negatives, remember


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#11 2008-05-09 23:40:55

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

Re: Scrolling help - again!

Bluestribute wrote:

archmage wrote:

Try something like

if scrollX>1000
set scrollX to 0

No Archmage, it's <1000. You use negatives, remember

Hey, what I said still works. If you go left the number increases right? So when it gets over 1000 it goes back to 0. If you wanted it to reset when you move to the right then you would put scrollX<-1000.


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

 

#12 2008-05-09 23:41:50

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Scrolling help - again!

archmage wrote:

Bluestribute wrote:

archmage wrote:

Try something like

if scrollX>1000
set scrollX to 0

No Archmage, it's <1000. You use negatives, remember

Hey, what I said still works. If you go left the number increases right? So when it gets over 1000 it goes back to 0. If you wanted it to reset when you move to the right then you would put scrollX<-1000.

Yes, I know you were still right> I just never use left scrolling. I just make it a wall kinda


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#13 2008-05-27 18:43:11

piemaster
Scratcher
Registered: 2008-05-07
Posts: 100+

Re: Scrolling help - again!

<(  <10>>  )><when green flag clicked>


Chumbucket

Offline

 

#14 2008-05-27 18:47:04

CFCRubiks
Scratcher
Registered: 2008-05-11
Posts: 100+

Re: Scrolling help - again!

http://scratch.mit.edu/projects/CFCRubiks/174476 You can use those. Not very complicated ,and now I'm adding changing backgrounds. P.S, If you download it and dont get the 1000 part, I just needed to use a big number to get a deciaml

Offline

 

#15 2008-07-08 12:58:23

tro95
Scratcher
Registered: 2008-02-20
Posts: 78

Re: Scrolling help - again!

Try This!!!!!
Try some of my projects. I make some simple, understandable and easy scrolling and loop scrolling tutorials. If you want loop scrolling I have 1 tutorial only demonstrating the X co-ordinate but I have a project, (called 360 Degree Panorama) which displays loop scrolling on both the X and the Y co-ordinate.

TRO95

Last edited by tro95 (2008-07-08 12:58:47)

Offline

 

Board footer