I looked on the wiki, but I can't find anything about how to do infinite scrolling.
Offline
Infinite scrolling requires the use of ()mod() I think.
Just treat each of your x number of costumes as:
1, x+1, 2x+1,...
2, x+2, 2x+2,...
So you'd have to use the modulus function.
Sorry if this description isn't good.
(which infinite scrolling do you want: a one bg? or multiple bgs?)
(or... what is your definition of infinite scrolling?)
Last edited by kayybee (2013-02-11 14:09:21)
Offline
Sqervay wrote:
I don't understand modulo
Modulo means remainder. (5mod3 is the remainder when you divide 5 by 3. so 2. 8mod3=2, 100mod3=1, 100mod5=0, etc.)
So let's say you have 5 costumes.
If you set a variable and tell it to increase by 1 every second or so, you can also have it change costume to the set variable.
So var = 1, costume # = 1
var = 2, cost# = 2
...
var = 5, cost# = 5
var = 6, cost# = ???
There is no sixth costume so it has nothing to change to!
if you want it to change to 1, you have to do (var)mod(5)
so 6mod5=1
7mod5=2
it kinda breaks when you get to multiples of five but you can add a conditional or just change some numbers to fix it. (add one to each one, and start on 0)
this has more practical uses.
Let's say you're a spaceship. when you reach the right of the screen, you should continue going through the left.
you add 240, then mod by 480, then subtract 240.
you add/subtract because the coordinate system is origin based, so you want to get 0 on the left edge. you mod by 480 to get it's wrapped coordinate. if it's 4 too much to the right it should appear 4 right of the left edge. 484mod480=4, so that would work.
you can also do this with scrolling.
Offline
My way is the easy way, but it would not work for something with over 3 costumes of scrolling.
Offline
If you'd like to look, there'a also the infinite scrolling engine that I've made.
Offline
Bump
It would be from a bird's-eye view--I want to turn http://scratch.mit.edu/projects/Firedrake969/2964997 into infinite scrolling.
Offline
firedrake969_test wrote:
Bump
It would be from a bird's-eye view--I want to turn http://scratch.mit.edu/projects/Firedrake969/2964997 into infinite scrolling.
Ahhh... okay. I'll look into it, though before I do, would you rather have stamping or nine sprites?
Offline
Okay, after altering a few scripts, here's what I've made:
Infinite Scrolling Sim Engine
I hope that this helps!
Offline