Endless Runner Background Issue

CrestwoodCrestwood Member Posts: 80
edited June 2012 in Working with GS (Mac)
I have created my far background, but can't get it to wrap. I have it slowly scrolling but when it gets to the end of the image the background just goes black. My actor is constrained to only move on the vertical at this time, and the sky in the background is moving. I tried to use Tshirbooths cloud tutorial, but it still wont recycle the background actor once it hits 0 on the X.

Any good tutorials on runners?

Best Answer

Answers

  • EatingMyHatEatingMyHat Member Posts: 1,246
    Did you set the wrap X property for the scene?
  • CrestwoodCrestwood Member Posts: 80
    Yes. I made my image long on the X so it would not repeat. Now I get some funky image jumping when it scrolls.
  • EatingMyHatEatingMyHat Member Posts: 1,246
    What do you use for movement? Move behavior?
  • CrestwoodCrestwood Member Posts: 80
    I changed the Motion-Linear Velocity-X in the actor attributes. Made it -40. It scrolls but I cant get it to wrap smoothly.
  • EatingMyHatEatingMyHat Member Posts: 1,246
    try using a Move behavior, should be smoother
  • CrestwoodCrestwood Member Posts: 80
    Thanks for the help EatingMyHat. What you sent me works fine, but once I try to increase the image size larger than the scene it gets funky.

    I am trying to create sort of a parallax type background with different layers. For the furthest background, it is a sky, then closer is a city, and then up front is the ground below. I am creating this for a landscape IPAD. I created the sky background image in photoshop, but created it a lot longer than 1024pixels. I knew I would have to recycle the image, but wanted to get as much variety in as I could. This is the reason I made the image 4096pixels wide. I can wrap an image using the example you sent me and it works great! But once I make it larger than the screen, it does not work so well. I am not sure how to go about this.

    Maybe I am thinking of doing this in the incorrect way.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    If you use wrap, it won't work properly... If something's larger than the screen it'll be trying to wrap it even though it doesn't fit within the screen size. Make an image that is the size of the screen, say if we are using iPad, then 1024 px wide and select Tile under the Horizontal Wrap found in the Graphics tab. Now make the image 2 times the size (so 2048) and set it so that when self.Position.X is equal to or less than 0 change position to 512.

    Play around with that... I'm away from home and my Mac, so can't test.

    Ace
  • CrestwoodCrestwood Member Posts: 80
    Thanks for the tip ace, but once I select tile, resizing the image does nothing. I think the software takes a snapshot of your image at 1024 and that's what it uses. I set it to tiled and it just loops a bunch of 1024 wide images. Changing the size of the image does nothing. Even if i stretched it out to 4096, it still used 1024 tiles.

    I guess my only option is to make a very long scene. I have seen other games on here do similar things, just not sure how.

  • CrestwoodCrestwood Member Posts: 80
    Looking at the template that came with the game, there is a basic Shoot Em Up game. It is made for the the iphone at 480 px wide, but I see the ground is 1024. I don't mind having a background that will repeat, just not every 1024 pixels.

    Rendering that in photoshop will be interesting.
Sign In or Register to comment.