I have this project I'm working on that involves a stickman jumping from mountain to mountain and if he doesn't make it to the next mountain then he loses. I need the mountains to scroll across the screen correctly. I know how to make them scroll past but I don't know how make them scroll across evenly. After the mountains scroll past a few times the distances between each mountain changes drastically. Either there is a gaping hole in between each mountain or all the mountains are clumped together. I don't know how to time the mountain scrolling so that mountains never overlap and never have a hole to large in between. I just can't seem to find the formula for this.
Also, these mountains aren't the same every time. They randomly change their costume to add some variety and difficulty to the game. Sometimes they're small and sometimes large and so on.
Last edited by bullelk12 (2012-08-12 20:52:40)
Offline
I think you can just use the script below with "some number" being different for each mountain. The first mountain can be "0", the second one "40", the third one "80", the fourth one "120", etc. As long as those differences remain the same, they should scroll evenly-spaced.
when gf clicked forever set x to ((((scroll-X)-(some number)) mod (480))-(240))
Offline