Scroll out and scroll in parallax background

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By tothricsaj

Hello guys,

I searched the almost entire internet and I found only infinite parallax background demos. That were great btw…however I need solution of scroll out/in parallax background because it would be the game levels (or scenes, depends on terminology). I have a solution but no satisfaction for me…

This is the scroll in mechanism:

	if(self.position.x >= 2100):

	for elem in City.get_children():
		elem.visible = true

…and this is the scroll out:

	if(self.position.x >= 8300):
	for elem in City.get_children():
		elem.motion_scale.x = 1
		elem.motion_mirroring.x = 8000

Furthermore, the mirroring of parallaxLayer is 2000 and default visibility is false as well as the whole background is inside the player’s scene. This means the self.position is position of the player.