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

#1 2012-06-07 18:39:13

Randomness_Player
Scratcher
Registered: 2012-06-06
Posts: 20

Scroll Y

Hi, am making a game available on the IPad and IPhone but am making it on the computer... I am making a game called "Tiny Tower"
___________

I have been wondering how do I scroll up... when you press up and when you use the elevator just by clicking the elevator... can you please help me?

Offline

 

#2 2012-06-07 19:12:48

PhirripSyrrip
Scratcher
Registered: 2012-02-11
Posts: 100+

Re: Scroll Y

Yeah you probably should have been more specific but luckily for you, I've played Tiny Tower and I think I know what you're on about. Do you want to know how to do y scrolling like in the game? Basically, it's like x scrolling except wherever you see the number 480, replace it with 360. Here's an example.

For the first picture of the scrolling background:

forever
set x to (0)
set y to ((ScrollY)+([360] * [0]))
for the second scrolling picture;
forever
set x to (0)
set y to ((ScrollY)+([360] * [1]))//basically, change "1" to the picture number for each picture in the scroller
You also need to include this script:
forever
if <key [up arrow v] pressed ?>
change [ScrollY v] by [10]
end
if <key [down arrow v] pressed ?>
change [ScrollY v] by [-10]
For more info, see this wiki article.


http://i46.tinypic.com/ao03lk.png

Offline

 

#3 2012-06-07 19:20:55

Randomness_Player
Scratcher
Registered: 2012-06-06
Posts: 20

Re: Scroll Y

Thank you!!!

Now am going to let my cousin test to see if its fun :p

Offline

 

Board footer