Hi I need to make a seamless background “loop” so that it never ends as i move (making a side scrolling space shooter ).
Any idea how this is done ?
hello
same question by me.
i add physics for my image and put the value of gravity coordinate Y is 2 and background moves downward but how can i create a loop
any idea please share
Regards
Here is an example.
The idea is to create two instances of your background. When one of them is over Y=600 (screen height), we place it at Y=-600.
BackgroundLoop.zip (164 KB)
how you moves your background downward?
i cant understand
please explain
This event add a constant force of 90° (which means downward, look at the third picture here : wiki.compilgames.net/doku.php/gd … s_concepts) to the two backgrounds. I repeat that you have to create 2 objects “Background” into your scene. The first one is at X=0;Y=0 and the second one at X=0;Y=-600 (or - the value of the heigth of your game screen).
Don’t forget to enter the value of your force with *TimedDelta() at the end (to understand why, I recommend you to read the link I gave you).
This event will move the lowest background to the top in order to perform the loop. Indeed, we move it to -600 when it left the screen.
I made a little mistake : change “>” by “>=” or “=”.
Note : you don’t need physics to do that.