How do I fix scrolling issue....

0 favourites
  • 6 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • I'm trying to make a background where the fog scrolls endlessly but I'm having an issue with it. It seems to be fine up to a certain point and then for some reason it stutters, which doesn't look great. I don't exactly know what it's doing, it seems like after a certain point the image flips (maybe?) which causes the stutter, i'm not sure.

    I've posted the capx file so you can see what i'm on about.

    Hope someone can help.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The problem is that you are not taking into account the actual image width (856 px) and that causes the jump.

    For some reason I can't upload right now the fixed capx, but the event should look like that:

    if Fog X <= (less or equal) to -856 ---> Fog set X to 0.

    Also, the black Sky tilled object is a bit overkill in size! If you want a single BG color you could just set the bottom layer to be opaque and set its color to black. You can also use a sprite much less in size and stretch it to fill your sky, even a 64x64 with a gradient will suffice if you have pixel rounding set to Off in project settings.

    -EDIT-

    Ok, antivirus was messing around, here is your capx: http://www.eli0s.com/Tests/ScrollingFog.capx

  • Ashley In rayrays' example I notice the same stutter phenomenon that we discussed in this topic https://www.scirra.com/forum/viewtopic.php?f=146&t=99765.

    In general, the fastest the movement is, the more evident the discontinuity gets. Surely, there has to be a way to overcome this, I mean, I am previewing this on a very decent desktop, the fps are fixed at 60 and yet, if I stare on one point on my screen, the stutter is very prominent and it occurs constantly, some times even more than once every second.

  • eli0s - the correct fix is to set the X to Self.X + 856. If you set the X to 0 you ignore any overshoot. At 750px/sec it's jumping about 12 pixels per tick, so it could end up as far as X = -868. If you just set X to 0 it will visually appear to jump by 12 pixels, but if you move it back by its own width it takes those extra 12 pixels in to account and remains smoother. With that applied it seems perfectly smooth.

  • Ashley I stand corrected, I understand now the flaw in my logic. The result is indeed much smoother. But the stutter remains at the same levels as I describe it on the other post. In a little more complex scene (with a platform behavior and a couple of solid objects), every now and then there is a gap in the fluidity of motion. It's very small, not necessarily tied with a drop in frame rate (just enough times to raise suspicion) and, to my eyes, annoying. I tried to capture my screen at 60fps to show you what I mean, but using a screen capture software really destroyed the frame rate.

    Perhaps it's just me. I am one of those guys that was annoyed with the old CRTs because of the flickering.

    Thanks for your response, I learned something again today!

  • eli0s Ashley Thank you for your responses. That's really helped me out with my issue so i appriciate you guys taking time out to help. Also, i only used a black background because i thought it would be clearer to see the fog (probably not the smartest idea lol) and i already had one on my desktop as i was working on something. My background is going to be in much more than just plain black

    Thanks again.

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