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

#1 2010-07-18 20:26:04

Ericthegreat
Scratcher
Registered: 2010-07-15
Posts: 12

Background Scroll

How Do You Make Your Backgrounds Scroll?? Do You Have To Make Infinite Costumes??????


Check Out My Awesome New Projects:   Pokemon Battle Arena, and God Of War: Battle Of The Universe!
Scratch on!!!

Offline

 

#2 2010-07-18 20:31:24

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Background Scroll

Nope, there's a much simpler way.

You might want to take a look at this project, it gives a few scripts that might be able to help you out. (The project should be included in Scratch, but in case you deleted it, that link will work fine.)

Offline

 

#3 2010-07-18 23:23:55

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

Re: Background Scroll

The background in scrollers isn't a stage costume at all! It's a bunch of sprites that just move!  big_smile

Make two sprites that span the entire x-axis. Then on the first one, put this:

Code:

when green flag clicked:
Forever
    Set x to: (scrollX + (480 * 0))
Endforever

And on the second one:

Code:

when green flag clicked:
Forever
    Set x to: (scrollX + (480 * 1))
Endforever

Then change the scrollX variable, and see what happens!

You can repeat this pattern with as many background sprites as you want.

Last edited by Harakou (2010-07-18 23:24:59)


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

 

#4 2010-07-19 10:55:30

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

Re: Background Scroll

One trick is to keep the player sprite in the middle, then use Scrollx to move everything else around the player while the player sprite costume changes between walking costumes.


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

Offline

 

Board footer