This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-12-11 20:40:39

Morphed
Scratcher
Registered: 2009-12-09
Posts: 89

Click here to Know a trick!

If you know how to make a scrolling game, Leave. If not, this is a very useful post for you.

1. make a new sprite that will either be the backround or some of the terrain for your game.Make a variable called Scrollx or something similar.

2. Make the following script:

<when green flag clicked>
<forever>

<set x to( ((<{  }>  <+>(( 480 <*> 0 ))  ))
<end>

In words, do when green flag clicked forever set x to Scrollx + 480 times 0.

3. Now, here is the part most people get confused on, so pay good attention.

So, by now you have one sprite that has the script on it.  Repeat step 1 and 2 by making another terrain sprite with almost the same script, but:

instead of 480 times 0 do 480 times 1.  If you make a third, fourth, fifth, etc. terrain sprite change 480 times a number that is 1 higher. If you don't understand that part say it below.


4.Now, when you are satisfied with the amount of backrounds/terrains you have, make or import a new sprite that will be the character or RPG sprite. Make a script on this sprite that says:




When green flag pressed  -

Forever  -

If- Right arrow pressed  -

Change Scrollx by - 5  - (or 10,15,20,25 even. it depends how much you want the sprite to move.)

If left arrow pressed change Scrollx by 5  -

[large empty space removed by moderator]

big_smile
Well, experiment! I hope you found this useful and ask a question below.

Last edited by cheddargirl (2010-04-13 21:07:45)


http://scratch.mit.edu/static/icons/buddy/435431_med.png?t=2010-01-24+19%3A31%3A51 "A bird In the hand is better than above you."
Wowie. Econimy go boom daddy....

Offline

 

#2 2009-12-11 20:49:29

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Click here to Know a trick!

Please, don't leave a huge space. It takes up room and is kinda stupid. Can you shorten it?
Also, don't forget gravity. People miss out on that...


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#3 2009-12-11 20:57:57

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Click here to Know a trick!

And how is this a trick? There is already lot's of tutorials on scrolling.  hmm   wink


Hai.

Offline

 

#4 2010-04-13 20:21:52

Arashaun
Scratcher
Registered: 2010-03-12
Posts: 7

Re: Click here to Know a trick!

Add Better Script Pictures, Great Tutorial, Don't Forget Gravity


<embed width="384" height="206" bgcolor="#FFFFFF" src="http://www.spore.com/flash/csa_widget.swf?userid=500436587739&username=G3N3515&host=http%3A%2F%2Fwww.spore.com%2Fview%2Fuser-thumbnail" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" scale="showall" name="latest-creatures" /></embed>

Offline

 

#5 2010-04-13 20:25:24

AmoebaMan
Scratcher
Registered: 2009-01-26
Posts: 500+

Re: Click here to Know a trick!

ummmmm why the heck is this in "advanced topics"?  this is basic.


http://i942.photobucket.com/albums/ad269/RyanScathe/AmoebaMan.png

Offline

 

#6 2010-04-14 23:22:25

noseyparka
Scratcher
Registered: 2009-05-30
Posts: 17

Re: Click here to Know a trick!

thanks a heap!

Offline

 

Board footer