How to remove the white space between wrapping background

0 favourites
  • 11 posts
From the Asset Store
Winter island themed set of tiles for your platformer game
  • Hi,

    I got a another problem need help, I am making a continuously wrapping background, but it always contains a vertical white space between 2 backgrounds, someone knows how to remove it? thanks

    Pls see my file in the link:

    https://www.dropbox.com/s/w5pkfskdlbg2reb/2.capx?dl=0

  • Use a graphics program to make a single image out of the 2 images.

  • if I make the image to one, when it wraps, the white space will be larger than now

  • That's an older problem. Look here h*t*t*ps://w*w*w.scirra.com/forum/scrolling-tiled-background-c2_t63134

    I've made an example of an endless scroller with your capx without the wrap behavior.

    h*t*t*ps://drive.google.com/file/d/0B5FlDY8sggF4Y1QxSmk2REJPN0k/view?usp=sharing

    Hope that will help you.

    You have to delete the *

  • Erik101: thanks, you file works, but when I want to change the scrolling speed it still show the gap, like when I change "Sprite4.X-int(100*dt) "to "Sprite4.X-int(200*dt)", how can I figure this, thank you so much

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's better to use a tilled background for those kind of movement. I didn't check Erik's example but here is one that should work fine, no matter the scrolling speed.

    http://www.eli0s.com/Tests/2.capx (right click and choose Save Link As)

  • eli0s you are right. The problem are these sprites. But with your example I also get a gap, if the speed is 200 or above.

    laoniustudio

    I made a new example with only one tiledbackground, like eli0s suggested. This seems to work. I tested up to (2000*dt) without a gap.

    h*t*t*p*s://drive.google.com/file/d/0B5FlDY8sggF4Tm91RFhVY3VNeE0/view?usp=sharing

  • eli0s Erik101, thanks for your help, Erik101's work for me, thank you so much

  • Erik101, thanks for your help, it works for me, thank you so much

  • Erik101 , if the example that I posted above produces a gap, then perhaps something is wrong with your system.

    Your modified example (after mine) is in essence the same, but with a flaw that mine hasn't*: Mine takes into account the TB's current -x position and adds to it the proper offset (TilledBackground.width/2), while yours just set's its x position to 0. That might introduce jumps and apparent jerkiness to the scrolling movement, because if (for example) the scrolling speed is such that on any tick the TB.X is -853 and on the next tick the TB.X is -900 (and the condition for the set X to 0 meet), then there will be a 47px jump from the last position and the next one. On the other hand, if you add its width/2 to the current -x position when the <-854 condition meet, then you will take onto account the 47px offset and end up exactly on the same place.

    *Not because I'm smarter, but just because I had Ashley correcting me into the same thing some time ago

  • Had a similar issue with a version of frogger I wrote recently http://myconstruct2dev.blogspot.co.uk/2 ... ogger.html where the logs in the river were made up of different parts - left end, middle bits, right end, so I could change then length at will. Making them wrapped bullets worked fine except there were random gaps between the parts, all browsers. Manually wrapping the sprites seemed to fix the problem.

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