Make a parallax background scroll in a loop

Discussion in 'RGSS3 Script Requests' started by Austintatious, Sep 24, 2015.

  1. Austintatious

    Austintatious Veteran Veteran

    Messages:
    34
    Likes Received:
    8
    Location:
    America
    First Language:
    English
    I want to make a circular city that's a short, wide map that loops horizontally and is played as a 2-D platformer. Is there a way to make a picture of the city's "skyline" on the other side of the city scroll in a loop so it always looks like you're in circular city instead of long city that repeats.

    This is hard to describe but I can't for the life of me find or even draw a good example.
     
    #1
  2. MeowFace

    MeowFace Meow Veteran

    Messages:
    1,034
    Likes Received:
    178
    Location:
    La La Land
    First Language:
    Meowish
    #2
  3. Austintatious

    Austintatious Veteran Veteran

    Messages:
    34
    Likes Received:
    8
    Location:
    America
    First Language:
    English
    I tried to get it to do what I want, but I couldn't figure it out.

    Are there any other scripts that might work?
     
    #3
  4. MeowFace

    MeowFace Meow Veteran

    Messages:
    1,034
    Likes Received:
    178
    Location:
    La La Land
    First Language:
    Meowish
    [1] Put that script in your script editor below Material and above main.

    [2] In your map property, there's a note box, put this tag in it. <full lock parallax>/<tile lock parallax>

    [3] Set up a parallax sky there too.

    [4] In the same place, set up your map to loop horizontally.

    Now when your character move around the city in your map (horizontally), the sky background will act as if it's moving backward when compared to the tiles you use in building the city. Is that not what you want? Because from your top post, that's as far as i can understand.

    You can also go check on some youtube videos and link one here that does what you want if you can't draw it down on pictures.
     
    #4
  5. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,456
    Likes Received:
    2,844
    Location:
    Philippines
    First Language:
    Tagalog
    There is an option on the map for the parallax to scroll right?
     
    #5
  6. Austintatious

    Austintatious Veteran Veteran

    Messages:
    34
    Likes Received:
    8
    Location:
    America
    First Language:
    English
    After I put the <full lock parallax>/<tile lock parallax> in the note, it just makes the background static. You definitely understand though. I want to move the parallax backwards from the direction the player moves in regardless of whether he goes left or right AND I want it to be loopable. Maybe it's just loopable automatically? I still can't get it to go backwards though. I can't find an option to make the parallax scroll right/reverse direction and that's probably what I need.
     
    #6
  7. MeowFace

    MeowFace Meow Veteran

    Messages:
    1,034
    Likes Received:
    178
    Location:
    La La Land
    First Language:
    Meowish
    hmm.. i thought one of those tag allow the map to scroll..

    I just gave that script a try and seems like <tile lock parallax> is doing what you want but the moving backward part is a little to slow so it moves with the tile in front, but you can give it a small modify to work.

    at line 160 of the script you should see:

    return @display_x * 32 if parallax_tile_lock?

    change the part @display_x * 32 to something like 

    @display_x * 64

    This should make the parallax move backward compared to the tile in front.
     
    #7
    Austintatious likes this.
  8. Austintatious

    Austintatious Veteran Veteran

    Messages:
    34
    Likes Received:
    8
    Location:
    America
    First Language:
    English
    Thank you so much for your help MeowFace! For the record, the value that ended up making it look normal (ie the background changed at the same speed as the character walking) was about 45.
     
    #8
  9. MeowFace

    MeowFace Meow Veteran

    Messages:
    1,034
    Likes Received:
    178
    Location:
    La La Land
    First Language:
    Meowish
    You're welcome! And congratulations on your progress! ;)
     
    #9

Share This Page