Yesterday I made a parallax background for some combat scenes. Since these are for more of an rpg game, not a platform, I didn’t use the usual method of zooming the camera at different rates in different layers (if I’m understanding that method correctly). The characters on the battle screen don’t move, so it wouldn’t work.
I simply made 4 backgrounds, and set them moving left across the screen at different rates.
I set a condition for each background, that if there’s only 1, to create another at the right edge of the screen. This worked fine when I went to bed last night.
I wake up this morning, excited to learn of a new update, and my beautiful parallax background is broken. It was running now with a gap between the backgrounds.
Here’s a screen shot to demonstrate what I’m talking about
At first I thought, well it’s a new release, there could be a few bugs that slipped by testing. Let’s try it on the old version (beta 100). The same bug was now manifesting here too. I made no changes to anything between last night and this morning, yet for some reason it isn’t working right. I don’t know if it’s possible, but could the updated version (beta101) made some change to the json file so that it no longer worked? I can’t think of anything else.
After spending several hours troubleshooting and trying different fixes (i tried creating the backgrounds at background.X()+background.Width(), background.X()+ScreenWidth(), I tried creating a point on the right side of the background and creating a new background at that point. I tried changing the margin that the backgrounds are deleted at, using the "delete off screen behavior. I tried editing the collision masks of the item the background runs into to activate the spawn actions and probably some other things I’m not remembering now.
Here is the original code that worked last night:
The X location is just less than the right edge to account for the scrolling rate of the background so no blank spots pop up.
Here is what I did to make it work today:
If you look at the screenshot of gameplay above, you’ll notice that the foreground (background1) no longer has a gap. This is the only background that is manually deleted and not relying on the “destroy when goes off screen” behavior.
The biggest clue was that when I edit the behavior “destroy off screen” to change the margin the backgrounds are deleted, there was no change in behavior. The gap between backgrounds remained consistent. This seems to indicate that the behavior is no longer detecting the margins and deleting the objects as intended.
I am using Ubuntu linux 18; I don’t know if this bug will manifest in other versions.
If there’s anything else I can do to help isolate and identify this bug please advise, or if it’s user error.
Thank you for all your hard work in putting in new features to make GDevelop a better program.