hello, i just started using this program and dont know how to use it fully yet. I am making a project for school and need help. The assignment is to make an adventure game. For my project i would like the backround to move with the sprite as an endless loop creating a endless path for when you move the sprite. So when you move the sprite ( the sprite wont actually move, the backround will which i made a sprite too) please can someone help... this would be for the backround sprite...
[scratchblocks]
when [rightarrow] clicked
move (-5) steps
end
[scratchblocks]
when [leftarrow] clicked
move (5) steps
end
Offline
A way to do this would be scrolling, which you can look up on the wiki to get more help then we could give you.
http://wiki.scratch.mit.edu/wiki/Scratc … j673849j14
You can look through all those pages to find what you need!
Offline
Here's what I think:
the easy way is to make a separate sprite for each page.
make this variable:
In the stage or a separate sprite, make this script:scrollx
the bottom line should make it loop.foreverifright arrow ▼key pressed?changescrollx ▼by-5ifleft arrow ▼key pressed?changescrollx ▼by5setscrollx ▼toscrollxmod480*insert number of costumes here
I hope this helps, and works, too!foreverset x toscrollx+480*0increment the zero for each pageifx position=scrollx+480*0increment the zero here, tooshowthis "if" statement makes it hide if it's too far off the stage.elsehide
Last edited by thebriculator (2012-07-18 11:26:53)
Offline
thebriculator wrote:
foreverset x toscrollx+480*0increment the zero for each pageifx position=scrollx+480*0increment the zero here, tooshowthis "if" statement makes it hide if it's too far off the stage.elsehide
Just to explain a bit if you're new to scratch, the reason we use 480 in the scripts is because the scratch stage is 480x360. So if you were scrolling on the Y axis you'd use 360 instead
Offline
jono3814 wrote:
how would you set the backround to start at the first back round everytime you click the green flag ? so that the sprite starts at the first backround everytime you want to play...
Just have it set scrollx to 0
whenclicked
setscrollx ▼to0
Last edited by wolfdude999 (2012-07-18 13:00:25)
Offline