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

#1 2010-07-25 18:00:20

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Scrolling Question

So, I have different terrains/platforms. I want to have a random pick in order and get infinite scrolling. Get it?

Thanks!


Hai.

Offline

 

#2 2010-07-25 18:14:26

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Scrolling Question

Well, the easiest way would be for you to generate a list that has, say 20 items that are random and if you move past the one set to item ten, it deletes the first item and adds a random one to the end, but if you go less than ten, it deletes the last item and adds a random one to the begining.  Actually, that's probably a hard way to do it, unless you want it to be the same when you go backwards, and in that case, don't use the deletes.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2010-07-25 18:32:39

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Scrolling Question

Ok...thanks...I'll try that.

Thanks!


Hai.

Offline

 

#4 2010-07-26 17:57:05

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Scrolling Question

Bump? Any other?


Hai.

Offline

 

#5 2010-07-26 18:09:32

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scrolling Question

The only issue I can see would be that going backwards could yield different results. What I would do is simply have it add a new item as it is needed, so the list doesn't get crowded too much, and since a user probably isn't going to go awfully far.

Offline

 

#6 2010-07-26 18:16:37

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Re: Scrolling Question

Try looking at the scripts of archmage's project "Glide Scrolling Demo".

Here's a link

Not to take credit, though.  big_smile


http://i51.tinypic.com/20gcn5j.png

Offline

 

#7 2010-07-26 18:22:10

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scrolling Question

JeanTheFox wrote:

Try looking at the scripts of archmage's project "Glide Scrolling Demo".

Here's a link

Not to take credit, though.  big_smile

That's a great example - but that project doesn't scroll infinitely, unfortunately.

Offline

 

#8 2010-07-26 18:25:40

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Re: Scrolling Question

coolstuff wrote:

JeanTheFox wrote:

Try looking at the scripts of archmage's project "Glide Scrolling Demo".

Here's a link

Not to take credit, though.  big_smile

That's a great example - but that project doesn't scroll infinitely, unfortunately.

Hmm... I can send you some screenshots. Of the scripts, that is.


http://i51.tinypic.com/20gcn5j.png

Offline

 

#9 2010-07-26 18:27:30

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scrolling Question

JeanTheFox wrote:

coolstuff wrote:

JeanTheFox wrote:

Try looking at the scripts of archmage's project "Glide Scrolling Demo".

Here's a link

Not to take credit, though.  big_smile

That's a great example - but that project doesn't scroll infinitely, unfortunately.

Hmm... I can send you some screenshots. Of the scripts, that is.

Sure! I'm still not entirely sure how that would fix the problem of it not scroll infinitely, but I don't see why you shouldn't  smile

Offline

 

#10 2010-07-26 18:57:15

JeanTheFox
Scratcher
Registered: 2010-06-14
Posts: 1000+

Re: Scrolling Question

Sprite1 (Background size):http://jeans-random-site.yolasite.com/resources/Untitled3.png
Sprite2 (Background size):http://jeans-random-site.yolasite.com/resources/Untitled4.png
Stage:http://jeans-random-site.yolasite.com/resources/Untitled5.png
There!
Hope this helps  big_smile ,

Scratch On!


http://i51.tinypic.com/20gcn5j.png

Offline

 

#11 2010-07-26 22:14:16

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Scrolling Question

Thanks!  big_smile 
Coolstuff: Backwards is not a problem. It has automatic forward scrolling.


Hai.

Offline

 

#12 2010-07-26 22:17:29

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scrolling Question

fg123 wrote:

Thanks!  big_smile 
Coolstuff: Backwards is not a problem. It has automatic forward scrolling.

Oh, so you won't be able to go backwards? Then it really should be easy - take something along the lines of what JeanTheFox posted, then - it seems I grossly misunderstood your question.

Offline

 

#13 2010-07-27 00:19:15

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

Re: Scrolling Question

coolstuff wrote:

JeanTheFox wrote:

Try looking at the scripts of archmage's project "Glide Scrolling Demo".

Here's a link

Not to take credit, though.  big_smile

That's a great example - but that project doesn't scroll infinitely, unfortunately.

Try this one http://scratch.mit.edu/projects/archmage/82995

Also, it doesn't scroll forever because it was told not to. There is a script on the cat sprite with the variables Rightscrolllimit and leftscrolllimit just remove the blocks that contain those variables/


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

 

#14 2010-07-27 07:31:40

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Scrolling Question

archmage wrote:

coolstuff wrote:

JeanTheFox wrote:

Try looking at the scripts of archmage's project "Glide Scrolling Demo".

Here's a link

Not to take credit, though.  big_smile

That's a great example - but that project doesn't scroll infinitely, unfortunately.

Try this one http://scratch.mit.edu/projects/archmage/82995

Also, it doesn't scroll forever because it was told not to. There is a script on the cat sprite with the variables Rightscrolllimit and leftscrolllimit just remove the blocks that contain those variables/

Oh! Didn't realize that; sorry.  smile

Offline

 

#15 2010-07-28 11:31:09

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Scrolling Question

Arch: Thanks! Imma try taht right now.  tongue

EDIT: WHAT CAT SPRITE?  tongue

Last edited by fg123 (2010-07-28 11:31:55)


Hai.

Offline

 

#16 2010-07-28 12:04:48

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

Re: Scrolling Question

The project jeanthefox posted has a cat sprite with scripts that limit the scrolling. The one I posted has no cat sprite and does not limit 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

 

Board footer