The van is basically staying in the same place (moving a little to the left and right)
Basically you'd need just one script, that would move it's owner entity by decreasing its X position, and if X is lower than some threshold, it would increase it again and repeat the process.
while everything else moves. For example, the trees would be "recyclable" entities, that move from right to left, and when they're off screen, they skip back all the way to the right and then move through the screen again. Same for the fog, houses etc.
For example, the trees would be "recyclable" entities, that move from right to left, and when they're off screen, they skip back all the way to the right and then move through the screen again. Same for the fog, houses etc.
Basically you'd need just one script, that would move it's owner entity by decreasing its X position, and if X is lower than some threshold, it would increase it again and repeat the process.
Not wishing to sound harsh but all you do is to reset the x,y coordinnates for each object within a loop.
You set this up as a script you can call, and invokr it for the duration.
If you want to see this in action look at the cars in the background in the K'NOSSOS tutorial.
you need to set the sleep to between 5 and 10 otherwise it will take ages to cross the screen
to get the KNOSSOS demo
www.svarunentertainment.com
you need to set the sleep to between 5 and 10 otherwise it will take ages to cross the screen
What you need to do is have an if() statement inside the while loop, which will check whether the tree has moved too much, and reset its X position to 0.
This approach is not correct. What you want is the entities to start on the start position, move right and then, when they have reached a predefined position on the right they appear on the left.
I would also rethink what to use in the while() statement. You probably want this script to run for a specific duration of time, so you could probably use a counter variable.
4. In terms of question 3 I thought maybe if there was a way to only display a central area of the scene background, then the tree entities had enough time and space to appear at their initial positions while we don't see them, move across the visible scene area and then reach the limit positions in the second area that we don't see. Does that make sense? If yes, how do we display the central part of 2400 X 600 background? What can I make in SceneEdit or in scene_init.script?
Hope this screen will illustrate what I mean:
(https://image.ibb.co/i2sD7w/issue7.png)
Basically you'd need just one script, that would move it's owner entity by decreasing its X position, and if X is lower than some threshold, it would increase it again and repeat the process.
What you want is the entities to start on the start position, move right and then, when they have reached a predefined position on the right they appear on the left.
Not wishing to sound harsh but all you do is to reset the x,y coordinnates for each object within a loop.
I have not tested this code so if it produces errors let us know which errors appear
treebg1.X = 0;, remember?):
, or better yet try to solve them yourself first ;)