Zebra935 wrote:
Hi! I'm Zebra935. I just downloaded Scratch today, and I am hoping to learn a lot about it. It is perfect because it is much easier that regular script. Thanks
Hi! Welcome to scratch! Do you have any questions?
Offline
Hi there, Zebra935! Hope you enjoy the Scratch program and community. If you have any questions, just ask around.
Offline
You mean scrolling, where you walk along a terrain, and the terrain will move? I'll upload some scripts to show you when I'm on a proper computer.
Offline
Okay, first of all - it isn't a feature with Scratch, you program it yourself. Anyway:
Scrolling has one main variable, Scroll X. This variable records where you are on the area.
There are many ways to do scrolling. Here's the compact way, with two sprites for the terrain. The variables:
Scroll X: The usual variable that keeps track of where you are, nothing big.
Terrain number: The variable that tells the terrain sprites what costume to be in.
You need to have several costumes for each terrain sprite; they're going to be the only terrain sprites, so you'll have to re-use them.
There's an easier way to do scrolling, but with many sprites for the terrain. No terrain sprites are re-used - which means that the variable Terrain Number isn't needed.
You'll have noticed one thing we're missing - the script that sets the Scroll X variable! Well, there are two ways: One with velocity, and one without. Here are the two scripts:
And that's it. Some tutorials for scrolling:
archmage's Scrolling Done Right (many-sprite scrolling)
archmage's Efficient Scrolling Demo (two-sprite scrolling) (not exactly a tutorial, but you can download the project and take a look)
Any questions?
Last edited by Jonathanpb (2010-02-07 23:39:49)
Offline
hey zebra935 i just joined 2 would you pass on info 2 me??? : )
Offline