Scrolling background with limitations

SingleSparqSingleSparq Member Posts: 1,339
edited November -1 in Working with GS (Mac)
I have been able to set it up to scroll a background the opposite direction when I move my player (so moving player right has the back ground move left slightly) I have done this by telling the background that if the right is pressed move left.

My background is wider than the scene width so that when it moves, it is not showing the edges (not using a wrap). But what is the best way to stop it from moving completely at a certain point (like when I reach the end of the scene width) so that even though I'm pressing right button the background stops. I have tried a few things but looking for the best way to control it. I control the player from getting to a certain point in the scroll scene using borders - should the same be done with a background?

Comments

  • KamazarKamazar Member Posts: 287
    It can be done with borders, but a more elegant approach would be to just tweak your movement rule a little (you can do this with your character too).

    If right key is down
    If "background" is < (wherever you want it to stop)
    Then move left
Sign In or Register to comment.