Looping Background Help!

GamexcbGamexcb Member Posts: 179
edited November -1 in Working with GS (Mac)
I am working on a game and we have a background that we want to loop. We have two background tiles and we need them to move out toward the left of the screen and then move in the left. I have used Wrap X and Other methods but when the tiles go to the right of the screen they come apart revealing a tear! Any ideas? Help would be much appreciated!

-Gamexcb

Comments

  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    I'm just a little confused by what you mean the way you worded it. Is it just going to be a scrolling background that moves left and you want it to loop?

    If so, try this:

    Have a background actor that is 480 by 320. Drag 2 instances into the scene and place ones X position at 0 and the others X position at 480. This should place the 2 background instances right next to each other, connecting in the center of the screen and 2 halves hanging off both sides.

    Set up some rules in you background actor like so:
    Move Left: Speed 50 (any number based on preference)

    Rule: When attribute self.position.x is = -240
    --Change attribute self.position.x to 720

    So when each actor moves off the screen on the left, it will move it all the way to the right off screen just behind the other background actor and keep looping over and over.

    Let me know if that makes sense or is even close to what your looking for! Hope it helps!
  • GamexcbGamexcb Member Posts: 179
    Actually I have been working with gamesad for quite sometime and way more advanced codeing so to make a background loop is fairly simple. The issue I am having is that they start to come apart from each other or "tear."
  • jstrahanjstrahan Member Posts: 498
    Never had this problem
    Maybe post a demo of problem so we can fix
Sign In or Register to comment.