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

#1 2010-07-02 21:09:19

Silentstar
Scratcher
Registered: 2009-12-27
Posts: 100+

Any tips about scrolling

I want to creat a game that envolves scrolling but I do not know how to do it!Can anyone help?


http://internetometer.com/imagesmall/25077.png

Offline

 

#2 2010-07-02 21:14:13

Silentstar
Scratcher
Registered: 2009-12-27
Posts: 100+

Re: Any tips about scrolling

Plz!


http://internetometer.com/imagesmall/25077.png

Offline

 

#3 2010-07-02 21:17:46

Greentabby55
Scratcher
Registered: 2010-05-04
Posts: 50

Re: Any tips about scrolling

Archmage has a tutorial on it.

Offline

 

#4 2010-07-02 21:19:08

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Any tips about scrolling

In the sample projects in Scratch, there is a great scroller that demonstrates the basic principles of scrolling. It is called ScrollingDemo. (Number 8 in the sample games folder.)

Scrollers have background sprites the size of the stage. (You can make the scrolling background with just two sprites, but it's easiest to just make a sprite for each part of the background.)

You'll need a [scrollx] variable. Have each background sprite go to the x position of the scrollx, plus 480 times their number. (The first background to be shown will be number 1, second background will be number two, and so on.) The script for the first background will look like this:

http://i50.tinypic.com/vpub80.jpg

It's also important to have a sensor sprite. it will look like this: http://i50.tinypic.com/2q8zqcg.jpg
What's key is the sides, each of which is a different color. (You can adjust size based on your needs.) This allows you to tell it to move differently based on which side (represented by color) is touching something.

The sensor controls all movement of the player sprite, which just infinitely goes to the position of the sensor sprite. (Make sure to set the ghost effect on the sensor sprite to 100; this will hide it, but keep the sprite active, allowing it to function as normal.)

Hope this helps!

Last edited by Harakou (2010-07-09 16:53:44)


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#5 2010-07-02 21:58:41

Silentstar
Scratcher
Registered: 2009-12-27
Posts: 100+

Re: Any tips about scrolling

Thanx but too complicated!


http://internetometer.com/imagesmall/25077.png

Offline

 

#6 2010-07-02 22:02:06

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Any tips about scrolling

Silentstar wrote:

Thanx but too complicated!

My explanation, or scrolling in general?


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#7 2010-07-02 22:05:02

Silentstar
Scratcher
Registered: 2009-12-27
Posts: 100+

Re: Any tips about scrolling

Your explanation!My brain has been a little groggy 2day


http://internetometer.com/imagesmall/25077.png

Offline

 

#8 2010-07-02 22:32:54

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Any tips about scrolling

start with something simple, like making a sprite scroll off the side and back onto the other side


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#9 2010-07-02 22:35:14

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Any tips about scrolling

Silentstar wrote:

Your explanation!My brain has been a little groggy 2day

Heh, that happens. Try looking at some other explanations, and possibly come back to it later. You'll get it!  big_smile


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#10 2010-07-03 02:06:20

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Any tips about scrolling

I made a tutorial project on scrolling here... it's not the best method, but it's rather simple.  hmm


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

Board footer