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.
Dear Muties,
I've created a project called "Vehicle" and a scene called "Car" to achieve a rough replica of the scene from the original post here. All entities are loaded in the scene and the car entity has a simple animation of "movement" (smoke and mirrors, just like Mnemonic said
). Now I am stuck, because of several questions:
1. How should this scene be organized in terms of levels? In "Car" there are currently two layers: one for background2 (background image itself) and main for floor region and all entities. The idea is to mimic car movement by loading and moving trees and house in the background (behind the car) in the x-axis from left to right. I guess later the third level - for foreground trees - could be added, however the floor region can be only on the main layer. So, how do I organize the layers?
2. As you can see in the screen below, currently tree entities overlap the car entity, since all entities are loaded on the same layer.
Is there a way to solve this and make the car entity overlap and cover everything that is "behind"?3. I haven't found any info in the Documentation about scripting moving entities and the OldGuy entity in the demo project is pretty much static, so...
How do I move tree and house entities in the x-axis? Looked through "Scene object" and "Entity object" sections in the Scripting reference, yet didn't come up with something like "GoTo" analog for entities. I am pretty bad at understanding scripts. Mnemonic replied me there should be basically one script. The problem is I seemingly understand the principle, yet cannot specify that with appropriate commands in the form of a working condition. My guess was something like this:
while(treebg1.X>=1200)
{
}
but I don't know if this will be right and again, what method, command or parameter should I use to move entities?
I disabled actor as Game.MainObject and erased Molly's lines from game.script.
Should I make the car entity Game.MainObject now?So many questions and I've tried different approaches for 2 - 3 days. Please help me with this scene, guys! After all, such things are pretty common for adventure games, and I think others might need it too. We could add it to the free resources section when it's ready.
Here are links to the source files. I've had some issues with Dropbox recently, so I made both zip and rar archives of same scene:
https://www.dropbox.com/s/1ykixggujdcd5xv/Vehicle.rar?dl=0https://www.dropbox.com/s/5sjcz5isg5kj40m/Vehicle.zip?dl=0THANK YOU for your kind attention and friendly advice!