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:
step 4:add this to your player sprite:whenclicked
forevergo to x:ScrollX+480*00 is the position by screen, 1=right -1=leftifabs ▼of>x position480hideelseshow
step 5:add your content ie.people etcwhenclicked
foreverifkeyright arrow ▼pressedchangeScrollX ▼by3could be a velocity scriptifkeyleft arrow ▼pressedchangeScrollX ▼by-3
Offline
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:step 4:add this to your player sprite:whenclicked
foreverset x toScrollX+480*00 is the position by screen, 1=right -1=leftif>abs ▼ofx position480hideelseshowstep 5:add your content ie.people etcwhenclicked
foreverifkeyright arrow ▼pressed?changeScrollX ▼by3could be a velocity scriptifkeyleft arrow ▼pressed?changeScrollX ▼by-3
step 6:???
step 7:Profit
Fixedyourscripts ▼
Last edited by amcerbu (2012-05-07 12:13:08)
Offline
http://scratch.mit.edu/forums/viewtopic.php?id=96359
Last edited by ftf841 (2012-05-07 16:15:13)
Offline
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:step 4:add this to your player sprite:whenclicked
foreverset x toScrollX+480*00 is the position by screen, 1=right -1=leftif>abs ▼ofx position480hideelseshowstep 5:add your content ie.people etcwhenclicked
foreverifkeyright arrow ▼pressed?changeScrollX ▼by-3in order to go right, you actuallyneed to change the scroll variable negatively, positivelyto go left.ifkeyleft arrow ▼pressed?changeScrollX ▼by3
step 6:???
step 7:ProfitFixedyourscripts ▼
This script is now fixed, and should work.
Last edited by sonicfan12p (2012-05-23 17:07:19)
Offline
gooeygoo wrote:
Could someone help me with scrolling?
I want to make a adventure gamewhenclicked
setscrollx ▼to0setscrolly ▼to0
Your scripts are fixed.
Last edited by jontmy00 (2012-05-24 04:49:00)
Offline
Offline
Offline
Offline
You could do something like this:
whenclicked
go to x:162y:-2set scrolly toy positionset scrollx tox positionswitch to costume2set size to165%switch to costume1forevergo to x: scrollx y: scrollygo back5000layers
Offline