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

#1 2012-07-20 06:21:41

jono3814
New Scratcher
Registered: 2012-07-18
Posts: 17

ANOTHER WAY OF SCROLLING??!?!? urgent!

Is there another way of scrolling ?! Without using the following code...

Variable: scrollx

For the character sprite:
when gf click
Forver
If ( key right arrow ) pressed
Change scrollx by -5
If (key left arrow ) pressed
Change scrollx by 5

For the background that moves:
When gf clicked
Forever
Go to x: scrollx + 480*0 y: 0

Offline

 

#2 2012-07-20 06:25:57

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: ANOTHER WAY OF SCROLLING??!?!? urgent!

Not me, this is the main and common way, maybe wes or sci can help.


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#3 2012-07-20 07:18:33

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: ANOTHER WAY OF SCROLLING??!?!? urgent!

This is THE way, trust me. There are other ways, but the amount of math and trig is... *shudder*


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#4 2012-07-20 07:29:54

PullJosh
Scratcher
Registered: 2011-08-01
Posts: 500+

Re: ANOTHER WAY OF SCROLLING??!?!? urgent!

This might not be what you're looking for, but if you need something really easy you could  remix (or not remix, but give credit to) thishmm


http://www.blocks.scratchr.org/API.php?action=text&string=I'm_on_vacation!&xpos=155&ypos=90&font_size=30&bgimage=http://imageshack.us/a/img339/7215/sspeechsigapiforwords.png

Offline

 

#5 2012-07-20 08:18:34

jono3814
New Scratcher
Registered: 2012-07-18
Posts: 17

Re: ANOTHER WAY OF SCROLLING??!?!? urgent!

Mmmmmmm, when scrolling and you have objects to collect like say for instance money.. How would you position the money where ever you want on the stage ? Cause what I did is copied the scrolling code for the backround so that the money would move also and not just stay in a fixed position. But it only goes to the center of the page and can't be moved. How would you make the coin scroll when the background is aslo scrolling but position it where ever you want ?

Offline

 

#6 2012-07-20 08:21:18

wolfdude999
Scratcher
Registered: 2012-01-07
Posts: 1000+

Re: ANOTHER WAY OF SCROLLING??!?!? urgent!

You could use this


http://i48.tinypic.com/15yxmp4.png

Offline

 

#7 2012-07-20 08:26:13

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: ANOTHER WAY OF SCROLLING??!?!? urgent!

Oh, that is easy.

Here:

when gf clicked
forever
go to x: ((((480) * (1)) + (scrollx)) + (xoffset)) y: (0)//set the 1 to the start positon of the coin.
And a separate script for this:
when gf clicked
set [x1 v] to (0)
forever
change [x1 v] by (1)
set [x2 v] to ([sin v] of (x1))
change [xoffset v] by (x2)
This will make the coin go back and forth horizontally.

Last edited by berberberber (2012-07-20 08:31:44)


http://i47.tinypic.com/2iaa73k.png

Offline

 

#8 2012-07-20 08:55:58

jono3814
New Scratcher
Registered: 2012-07-18
Posts: 17

Re: ANOTHER WAY OF SCROLLING??!?!? urgent!

Thanks bro helped a lot (Y)

Offline

 

Board footer