Hey!
So i'm pretty new to scratch and decided to make a scrolling platformer type game, I have a problem though (Wahey!)
Whenever my character walks to the next part of the screen (Ground 2) the first part (Ground 1) is underneath his toward the end of it... If that makes sense? Any ideas? I've been trying for hours to work this out! haha!
Thanks!
Offline
I'm guessing, to specify, your problem is that once the first ground sprite is supposed to move offscreen, it remains onscreen and stops moving? In Scratch, the stage only extends so far to the sides, so you need to tell pieces of the ground to hide or show depending on whether it's onstage or not.
You can use a script like this to check if your ground sprite should be showing or hiding:
Offline
This is something frustrating, actually - in Scratch, you can't move the centerpoint of a sprite away from the edge of the screen beyond a certain point, which leaves it sticking out a little bit. The above poster's solution should work, though you may notice the background doesn't flow smoothly off the to left/right before it disappears. though it is at least better than putting up with the odd stacking problem, however, I figure it might be worth an explanation as to why it's not perfect.
Offline
Hope this script helps.
when gf clicked forever switch to costume [sensor v] if <color [#0042FF] is touching [#000008]?> if <key [up arrow v] pressed?> repeat (15) switch to costume [sensor v] change y by (10) if <key [right arrow v] pressed?> change [scroll v] by (-5) if <color [#00FF52] is touching [#000008]?> change [scroll v] by (5) end end if <key [left arrow v] pressed?> change [scroll v] by (5) if <color [#FF0000] is touching [#000008]?> change [scroll v] by (-5) end end switch to costume [ball v] end end end if <key [right arrow v] pressed?> change [scroll v] by (-5) if <color [#00FF52] is touching [#000008]?> change [scroll v] by (5) end end if <key [left arrow v] pressed?> change [scroll v] by (5) if <color [#FF0000] is touching [#000008]?> change [scroll v] by (-5) end end if <not <color [#0042FF] is touching [#000008]?>> change y by (-3) end switch to costume [ball v] end
Offline