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

#1 2012-05-07 08:29:50

gooeygoo
Scratcher
Registered: 2012-05-07
Posts: 82

Scrollx and scrolly

Could someone help me with scrolling?
I want to make a adventure game

when gf clicked
set (scrollx v) to 0
set (scrolly v) to 0


Play meh games, dont beh shy!!!
http://scratch.mit.edu/users/gooeygoo

Offline

 

#2 2012-05-07 09:00:39

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Scrollx and scrolly

because I know people don't like reading the wiki I'll do step by step instructions
step 1:create the ScrollX variable
step 2:create sprites for the whole map (there are other more complex ways but this is the simplest)
step 3:add this script to each one:

when gf clicked
forever
go to x:((ScrollX)+((480) * (0))) //0 is the position by screen, 1=right -1=left
if [abs v]( of (x position)) > (480)
hide
else
show
step 4:add this to your player sprite:
when gf clicked
forever
  if <key [right arrow v] pressed>
  change [ScrollX v] by (3) //could be a velocity script
  end
  if <key [left arrow v] pressed>
  change [ScrollX v] by (-3)
  end
end
step 5:add your content ie.people etc
step 6:???
step 7:Profit


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-05-07 12:11:48

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Scrollx and scrolly

zammer990 wrote:

because I know people don't like reading the wiki I'll do step by step instructions
step 1:create the ScrollX variable
step 2:create sprites for the whole map (there are other more complex ways but this is the simplest)
step 3:add this script to each one:

when gf clicked
forever
set x to ((ScrollX)+((480) * (0))) //0 is the position by screen, 1=right -1=left
if <([abs v] of (x position)) > (480)>
hide
else
show
step 4:add this to your player sprite:
when gf clicked
forever
  if <key [right arrow v] pressed?>
  change [ScrollX v] by (3) //could be a velocity script
  end
  if <key [left arrow v] pressed?>
  change [ScrollX v] by (-3)
  end
end
step 5:add your content ie.people etc
step 6:???
step 7:Profit

Fixed (your) [scripts v]

Last edited by amcerbu (2012-05-07 12:13:08)

Offline

 

#4 2012-05-07 16:15:00

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

Re: Scrollx and scrolly

http://scratch.mit.edu/forums/viewtopic.php?id=96359

Last edited by ftf841 (2012-05-07 16:15:13)


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

#5 2012-05-23 17:05:56

sonicfan12p
Scratcher
Registered: 2011-11-16
Posts: 1000+

Re: Scrollx and scrolly

amcerbu wrote:

zammer990 wrote:

because I know people don't like reading the wiki I'll do step by step instructions
step 1:create the ScrollX variable
step 2:create sprites for the whole map (there are other more complex ways but this is the simplest)
step 3:add this script to each one:

when gf clicked
forever
set x to ((ScrollX)+((480) * (0))) //0 is the position by screen, 1=right -1=left
if <([abs v] of (x position)) > (480)>
hide
else
show
step 4:add this to your player sprite:
when gf clicked
forever
  if <key [right arrow v] pressed?>
change [ScrollX v] by (-3) //in order to go right, you actually
//need to change the scroll variable negatively, positively 
//to go left.
  end
  if <key [left arrow v] pressed?>
  change [ScrollX v] by (3)
  end
end
step 5:add your content ie.people etc
step 6:???
step 7:Profit

Fixed (your) [scripts v]

This script is now fixed, and should work.  smile

Last edited by sonicfan12p (2012-05-23 17:07:19)


Why are the secret organizations getting all the attention?  mad

Offline

 

#6 2012-05-24 04:48:28

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Scrollx and scrolly

gooeygoo wrote:

Could someone help me with scrolling?
I want to make a adventure game

when gf clicked
set [scrollx v] to [0]
set [scrolly v] to [0]

Your scripts are fixed.

Last edited by jontmy00 (2012-05-24 04:49:00)


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#7 2012-05-24 04:51:10

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Scrollx and scrolly


http://trinary.tk/images/signature_.php

Offline

 

#8 2012-05-30 12:20:12

bluecat600
Scratcher
Registered: 2012-02-12
Posts: 500+

Re: Scrollx and scrolly


I gaze off into the boundless skyline, noteblock choirs playin in the sunshine, turn round pick up my sword and wield the blade that once forced evil mobs to yield, if this battle shall leave me slain, I know Herobrine still calls my name, better just take a stand, that was when I ruled the land.

Offline

 

#9 2012-05-30 12:57:15

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

Re: Scrollx and scrolly


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

Offline

 

#10 2012-05-31 23:04:28

sanjayraj
Scratcher
Registered: 2012-03-25
Posts: 500+

Re: Scrollx and scrolly

You could do something like this:

when gf clicked
go to x: (162) y: (-2)
set scrolly to (y position)
set scrollx to (x position)
switch to costume (2)
set size to (165) %
switch to costume (1)
forever
go to x: scrollx y: scrolly
go back (5000) layers


http://i46.tinypic.com/23sw40j.png

Offline

 

Board footer