Help Scrolling Background
757MinecraftCrazy
Member Posts: 9
in Tech Support
Lately I have had trouble doing a specific task. I have tried to have a background image scroll slowly as the game goes, but when the image comes to the end, I don't know how I'll repeat it. Mostly what I need to happen is when the image reaches the end, have the image loop as if the beginning of the background image was taped to the end to form a continuous loop. I have tried spawning a new instance of the background when it gets to a certain position, but that won't seem to work. Does anyone know of an algorithm or logic to make this happen?
Comments
Try checking wrap x or wrap y in the scene attributes.
Edit:
If you only want one actor to wrap then you can make a rule
When attribute self.position.x < 0-(self.size.width/2)
Change attribute self.position.x to 768+(self.size.width/2)
--
Change the 0 and 768 to whatever values you want it to wrap.
Fortuna Infortuna Forti Una
There is a scrolling background tutorial here, if you want to check it out:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page