Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make a side scroller?
- meowmoo
- Scratcher
500+ posts
How to make a side scroller?
first you make a variable,
(scroll x)then you have 3 ways of doing a side scroller. I normally do one way, because it has less lag. the thing is, to know how to make a side-scroller, you need to know how to make a platformer. do you know that?
Last edited by meowmoo (April 12, 2014 11:29:25)
- meowmoo
- Scratcher
500+ posts
How to make a side scroller?
one method though, is to have a movement script, then have this script after it:
if <(x position) > [0]> thenthen have another sprite with this script:
change x by (-1)
change [scroll x v] by (-1)
end
if <(x position) > [0]> then
change x by (1)
change [scroll x v] by (1)
end
when green flag clicked
switch costume to [hackDot v]//hackDot is just a dot
set size to (500) %
switch costume to [level v]//level is the level
forever
go to x: (scroll x) y: (0)
end
- matthewshoults
- Scratcher
41 posts
How to make a side scroller?
what would this do?? one method though, is to have a movement script, then have this script after it:if <(x position) > [0]> thenthen have another sprite with this script:
change x by (-1)
change [scroll x v] by (-1)
end
if <(x position) > [0]> then
change x by (1)
change [scroll x v] by (1)
endwhen green flag clicked
switch costume to [hackDot v]//hackDot is just a dot
set size to (500) %
switch costume to [level v]//level is the level
forever
go to x: (scroll x) y: (0)
end
- meowmoo
- Scratcher
500+ posts
How to make a side scroller?
the first script would convert a normal movement script into the nessacery variables for scrolling, and the other script moves the level around in order to scroll based on the variables. the way scrolling works is instead of having one “moving” sprite move around, you have the level move backward if you want the player to move forward,giving the illusion of player movement.what would this do?? one method though, is to have a movement script, then have this script after it:if <(x position) > [0]> thenthen have another sprite with this script:
change x by (-1)
change [scroll x v] by (-1)
end
if <(x position) > [0]> then
change x by (1)
change [scroll x v] by (1)
endwhen green flag clicked
switch costume to [hackDot v]//hackDot is just a dot
set size to (500) %
switch costume to [level v]//level is the level
forever
go to x: (scroll x) y: (0)
end
- Discussion Forums
- » Help with Scripts
- » How to make a side scroller?