Background scrolling effect on y axis.

GLGAMESGLGAMES SingaporeMember Posts: 988
edited November -1 in Working with GS (Mac)
Hi guys,
since my first game is waiting for review, i'm planning to finish up my 2nd game which is a platform jumping game. I am trying to make the background scroll seamlessly on y axis. Can someone point out an example for me? I remember seeing it somewhere using interpolate and 2 similar backgrounds put side by side but cannot find that post anymore.

Comments

  • mangaroomangaroo Member Posts: 419
    Parallax Scrolling. I can't do it (personally) with move - i only managed it on my running template (marketplace) with Spawn and Destroy:

    BG RULE:

    when attribute self.position.y > 0
    -> Spawn Actor (BG)
    x position = self.position.x & y position (relative to SCENE) = self.position.y - self.size.height

    So, basically when this image goes up with linear moment it will create a duplicate just behind it..it gets wiped after it goes off screen.

    Another Rule:

    when attribute self.position.y > self.size.height
    ->destroy actor

    `````This works BEST when the bg covers the screen/positioned properly...

    Good luck! Heres a link to a template i just made for it:

    http://www.fileserve.com/file/BG7XJfq

    If someone knows a more efficient way i would love to know myself!
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    You don't want to be spawning all the time, especially big images like a background or it will crush the device.

    It isn't parallax scrolling what he is on about, parallax scrolling is different images moving at different times to give a 3D depth effect.

    What is the background going to be? A sky? If so there is a miles easier way to do it which uses virtually no resources.

    Ace
  • mangaroomangaroo Member Posts: 419
    Its not the best as i said, but it works - I can't really do a seamless background without it...but then again im new

    " If so there is a miles easier way to do it which uses virtually no resources."

    Thanks for the info...! :/ Anyone aware of a better way?
  • old_kipperold_kipper Member Posts: 1,420
    Can it not be done with three actors for the background?

    two for the crossover of images onscreen and a third which is moving to the position to be ready to be visible (dependant on direction of scroll)
  • mangaroomangaroo Member Posts: 419
    the problem is as soon as part of the image moves down - u have a space where it moved from...the only way to fill in that gap and create a seamless background is to have no gaps - so no gaps + constant moving...has to mean constantly producing the images - unless u split your background into like 5 or so similar actors and try it like that...might help reduce the damage of spawning large backgrounds
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    mangaroo said:
    Thanks for the info...! :/

    I was asking if that's the way he was doing it so I could help out, I want all the information so I know I'm helping properly, doing it with NO spawns is best for the devices memory, especially big files. I don't want clever remarks when I'm trying to help, especially from someone who just said they were new and didn't know of a better way. I was on my iPhone whilst recording in the recording studio trying to help out in between takes.

    @george Email me more details and I'll set up a file for you as I have some free time tonight. Info@instantmashgames.com

    Ace
Sign In or Register to comment.