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 showstep 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 endstep 5:add your content ie.people etc
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: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 showstep 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 endstep 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
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: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 showstep 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 endstep 5:add your content ie.people etc
step 6:???
step 7:ProfitFixed (your) [scripts v]
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 gamewhen 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)
Offline
Offline
Offline
Offline
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
Offline