Infinitely scrolling background

This forum is currently in read-only mode.
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I'm going to be making a parallax background, but instead of extending the level by whatever amount I'm just going to have the backgrounds scroll and loop endlessly. I'm wondering if Construct has built-in support for this or if I'm left to my own inventions.

    If you don't understand I'll try to explain it. Imagine a 200x100 image that connects on the right and left so that if you were to place them side-by-side they would look continuous. This is essentially the idea, but I'd rather not have to make the level huge and just have the image scroll through itself continually.

  • There is an effect named "offset". By changin the offset value in runtime you can make continuously scrolling image.

  • Sorry, could you give an example. I'm not understanding.

    I currently have Every Tick: TiledBackground: Offset: Set Offset Y to 100 * TimeDelta. This does nothing.

    I've also tried placing it in Start of Layout rather than Every Tick.

  • http://www.4shared.com/file/138306311/b ... round.html

    you could do it like this, it uses two background/sprites set next to each other moving at the same x speed - at the end of the screen the first one sets it back to the beginning,

    done it quickly, you could much improve it using vars, you could even use the same sprite i guess, with some picking event

    but just shows the idea

  • It's much easier to do with offset: http://www.mediafire.com/?zyudkmnmz5m

  • but can you move the background while the player stays in position with this function?

    edit: ow i misunderstood the question i think

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm not sure I explained it properly. My layout will only be 1024x768 in size. I want the tiled background to, for example, scroll continuously at the sides regardless of whether the character is moving or not.

    EDIT: Aphex, your example is what I'm actually looking for, I just didn't know if there was a more automated/efficient way of doing it or if I should just do it like that.

  • no the offset works

    i just tested it by adding a global var 'counter'

    and always add 1 to the counter en put that var in x offset

  • You can use a tiled background, set its X offset to whatever you want it to scroll like - if you want it to scroll with the character, set X offset to Character.X*factor (factor being scrolling speed, parallax). If you want it to scroll over time, set X offset to, umm, whatever that system expression for ticks is. To make sure it doesn't overflow, just substract it by tiled background image width whenever it goes over that number.

    My mind is blank at the moment and still don't have Construct installed, so hopefully someone else can produce an example.

    Or using the global counter works, too. Just remember to reset it to zero after the background is fully looped, otherwise it will overflow in the future.

    Instead of adding 1, add 60*timedelta, 60 being scrolling speed you can adjust if you want. Smooth scrolling!

  • Ok, i misunderstood the question. Just do what Aphex said.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)