Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » 2D Side Scroller - Item Loading
- Kemek78
-
13 posts
2D Side Scroller - Item Loading
I was thinking, is there a way to make a side scroller without those stupid side borders? So far all I've come up with is loading 1/4th of the texture then as it got closer load 1/2 then 3/4th then the whole texture to give it enough room. It would be semi-complicated but would it work? I haven't had time to test anything yet.
- best-games-ever
-
500+ posts
2D Side Scroller - Item Loading
That might work but the most easy way is to make the background bigger.
- Kemek78
-
13 posts
2D Side Scroller - Item Loading
I'm talking about items loading in on the edges of the screen as you run. That might work but the most easy way is to make the background bigger.
- deck26
-
1000+ posts
2D Side Scroller - Item Loading
It's not easy to completely avoid problems at the edge of the screen with a scroller since Scratch will always want at least part of the sprite to be visible so at the point it first appears at the edge there is the risk a thin band suddenly appears.
If the backgrounds appear in a fixed order though you can potentially allow an overlap so the new sprite/costume is hidden until it is far enough on screen that the minimum amount Scratch insists on showing isn't a problem.
If the backgrounds appear in a fixed order though you can potentially allow an overlap so the new sprite/costume is hidden until it is far enough on screen that the minimum amount Scratch insists on showing isn't a problem.
- mstone326
-
1000+ posts
2D Side Scroller - Item Loading
There was a method posted on here a while back about the edges of screens and using a set size block at the top of the loop and another at the bottom which would hide the 5 pixels of the sprite. It does work but in a project with many tiles using changing size this ended up laggy at times. You can do it with a costume as well.
I forget who posted this method with the set size, but it wasn't me. I tried with the costume change though. Works except the x position falls a bit, probably because I eyeballed 2x size on the costume.
https://scratch.mit.edu/projects/177117177/#player
Edit:
Fixed the big costume to 2x size, the x position does not lag behind anymore.
I forget who posted this method with the set size, but it wasn't me. I tried with the costume change though. Works except the x position falls a bit, probably because I eyeballed 2x size on the costume.
https://scratch.mit.edu/projects/177117177/#player
Edit:
Fixed the big costume to 2x size, the x position does not lag behind anymore.
Last edited by mstone326 (Sept. 29, 2017 11:52:08)
- DaEpikDude
-
1000+ posts
2D Side Scroller - Item Loading
Start of script: set size to 200%
Then do placement stuff.
End of script: set size to 100%
Boom.
Then do placement stuff.
End of script: set size to 100%
Boom.
- Discussion Forums
- » Help with Scripts
-
» 2D Side Scroller - Item Loading