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
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.
Offline
johnnydean1 wrote:
Look at my thread!
Wait, did you make this because I said it or did you really think of it yourself?
Offline
Well I do do alot of things
*Its not a typo on the 'do'
Offline
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)
Offline
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.
Offline
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
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)
Offline
Offline