Is there another way of scrolling ?! Without using the following code...
Variable: scrollx
For the character sprite:
when gf click
Forver
If ( key right arrow ) pressed
Change scrollx by -5
If (key left arrow ) pressed
Change scrollx by 5
For the background that moves:
When gf clicked
Forever
Go to x: scrollx + 480*0 y: 0
Offline
Mmmmmmm, when scrolling and you have objects to collect like say for instance money.. How would you position the money where ever you want on the stage ? Cause what I did is copied the scrolling code for the backround so that the money would move also and not just stay in a fixed position. But it only goes to the center of the page and can't be moved. How would you make the coin scroll when the background is aslo scrolling but position it where ever you want ?
Offline
Oh, that is easy.
Here:
when gf clicked forever go to x: ((((480) * (1)) + (scrollx)) + (xoffset)) y: (0)//set the 1 to the start positon of the coin.And a separate script for this:
when gf clicked set [x1 v] to (0) forever change [x1 v] by (1) set [x2 v] to ([sin v] of (x1)) change [xoffset v] by (x2)This will make the coin go back and forth horizontally.
Last edited by berberberber (2012-07-20 08:31:44)
Offline