Hey guys,
I'm bussy creating a small video game with a background that is constantly moving from the top of my screen to the bottom. The problem is, as soon as it has completed its simple task of moving from one direction into another, it disappears from the screen. I've been trying for about an hour to get the object back to the top of the screen again, so it can start over moving down again, but unfortinately my poor coding skills haven't managed to do so yet.
What I basically want, is that the object gets 'rolled back' for a specific distance when it gets past an imaginairy line. And when it has been rolled back, I want it to start over with going to the bottom of the screen again. And when it gets back to that line, it must role back again etc. etc..
To give you a basic idea of what I want, imagine it like the tracks of a tank if you look at it from the side: 1 segment of the track will go from left to right over the wheels of the tank, as soon as it gets to a specific distance (the last wheel) the track goes down and then it will go from right to left. All segments of the track will do this, and they will all stay perfectly lined up behind each other.
Now I do not want to create tank tracks in my game, but the movig background I want could use an similar idea.
The script I am using right now to just move it from the top of my screen to the bottom of my screen (might be in diffrent directions for you) is attatched to this post. There are a few not needed lines in there, but that's because I am still working at it myself as well. If you have an idea of what i want, and if you know how to code it then all help would be very much appreciated
-Wes
Backgroundmovement.lua