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

#1 2010-06-20 09:13:04

NeilWest
Scratcher
Registered: 2010-01-06
Posts: 1000+

Scroll Y Answered!

When you use Scroll Y like Scroll X there's always that annoying gap, well i've sorted that out now, after days of hard testing and shouting i've came up with the perfect script:

<when green flag clicked>
<forever>
<set y to((( 480 <+>(( ( (whatever number your terrain is) .7  <*> scrollY  ))))

edited to not get confusion

Last edited by NeilWest (2010-06-21 13:42:13)

Offline

 

#2 2010-06-20 09:20:03

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Scroll Y Answered!

ScrollY is the same as ScrollX.

Unless you are using jumping scroll, which I myself love to use.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#3 2010-06-20 10:14:48

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Scroll Y Answered!

there's an even easier way to scroll: Make a REALLY big sprite that fills up more than the screen and have it move when you move the arrow keys. It works really well.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#4 2010-06-20 11:28:48

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Scroll Y Answered!

Look at my thread!


You can now reach me on Twitter @johnnydean1_

Offline

 

#5 2010-06-20 11:38:38

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Scroll Y Answered!

johnnydean1 wrote:

Look at my thread!

Wait, did you make this because I said it or did you really think of it yourself?


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#6 2010-06-20 11:44:35

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Scroll Y Answered!

I thought of it!


You can now reach me on Twitter @johnnydean1_

Offline

 

#7 2010-06-20 11:48:14

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Scroll Y Answered!

johnnydean1 wrote:

I thought of it!

Okay, I can believe that.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#8 2010-06-20 11:50:10

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: Scroll Y Answered!

Well I do do alot of things

*Its not a typo on the 'do'


You can now reach me on Twitter @johnnydean1_

Offline

 

#9 2010-06-20 13:24:28

16Skittles
Scratcher
Registered: 2009-08-26
Posts: 1000+

Re: Scroll Y Answered!

NeilWest wrote:

When you use Scroll Y like Scroll X there's always that annoying gap, well i've sorted that out now, after days of hard testing and shouting i've came up with the perfect script:
[blocks]
<when green flag clicked>
<forever>
<set y to((( 460 <+>(( ( (whatever number your terrain is)  <*> scrollY  ))))[/blocks]

there will probably still be a gap with this. you should replace 480 with 360. the stage is 480 pixels wide and 360 pixels tall.

Last edited by 16Skittles (2010-06-20 13:25:09)


http://16skittles.tk/sig.png
Are you a student? Check out OnSchedule!

Offline

 

#10 2010-06-20 13:34:27

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

Re: Scroll Y Answered!

Skittles16 understands how things work. The 480 represents the width of the stage. Its pretty common logic and shouldn't take days of testing.

Your thought process should be like this:
-There is a gap between the rows of sprites.
-The issue is the 480 number
-The number 480 represents the width of the stage
-Using 480 is inappropriate for this because the sprites need to snap together vertically not horizontally
-Using 360 will make the sprites snap together because 360 is the height of the stage

Now that wasn't too hard was it? You need to take that kind of approach when troubleshooting your programs.


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

 

#11 2010-06-21 13:40:51

NeilWest
Scratcher
Registered: 2010-01-06
Posts: 1000+

Re: Scroll Y Answered!

archmage wrote:

Skittles16 understands how things work. The 480 represents the width of the stage. Its pretty common logic and shouldn't take days of testing.

Your thought process should be like this:
-There is a gap between the rows of sprites.
-The issue is the 480 number
-The number 480 represents the width of the stage
-Using 480 is inappropriate for this because the sprites need to snap together vertically not horizontally
-Using 360 will make the sprites snap together because 360 is the height of the stage

Now that wasn't too hard was it? You need to take that kind of approach when troubleshooting your programs.

I was experimenting with numbers and i've accididently said the wrong thing,

Example:

for terrain 0 it would be 0.7 not 0

sorry

Last edited by NeilWest (2010-06-21 13:41:33)

Offline

 

#12 2010-06-21 14:19:31

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

Re: Scroll Y Answered!

Your script is still wrong

I don't think you properly thought things though. There is no reason to multiply the terrain number by .7 and I am going to assume you reached that conclusion by randomly putting numbers in.

I am not sure if you read my post properly where I outlined the kind of thought process needed to solve this kind of problem. You must understand what each value in the script means and by multiplying the scrollY variable it shows that you don't understand how the values work.

The funny thing is that even when people posted the answer you still push your own incorrect scripts.

<when green flag clicked>
<forever>
<set y to((( 480 <+>(( ( (whatever number your terrain is).7 <*> scrollY  ))))

The issue with this script is that you are altering the wrong numbers. In this script, the number 480 controls the distances between the coordinates of the sprites, the terrain number controls the order of the sprite, and the scrollY variable controls how much the user has moved the set of sprites.

Your script alters the values that control sprite placement and the value that determines how far the user has shifted sprites which is why the script is incorrect.

The scripts needs to look like this to work

<when green flag clicked>
<forever>
<set y to((( 360 <*>(( ( (terrain number) <+> scrollY  ))))

The only value that has changed is the value that controls the set distance between sprites.

I hope you read though this post and ask if there is anything you don't understand.

Last edited by archmage (2010-06-21 14:23:28)


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

 

#13 2010-06-27 11:57:49

NeilWest
Scratcher
Registered: 2010-01-06
Posts: 1000+

Re: Scroll Y Answered!

Oops. Fail

Offline

 

Board footer