Folgendes (ich schreibs mal in Englisch, damit auch ggf. andere Leute hier im Forum helfen können):
Scene: Background of the scene: Black, used to dimensionate the scene,
Object1: "animated_bg", containing 3 objekt animations:
1: "tunnel0", 1 Frame with image 1 , Loops [x], infinite ,
2: "tunnel1" , 1 Frame with image 2 , Loops [x], infinite ,
3: "tunnel2", 1 Frame with image3 , Loops [x], infinite ,
Object2: train background
Object3: train foreground
The animations from object 1 can be put stacked outside of the viewable scene. These animations will be moved via Lua.
SCENE ACTIONS:
------
At beginning of Scene Action:
Show animation: tunnel0
Show animation: tunnel1
Show animation: tunnel2
Call other Action: "movebackground" (will be created below)
(there is also an earthquake action part which is maybe usefull in the lowest setting to simulate the train jiggle)
-------
Called by other Action "movebackground":
Actiopart #1 : Execute a script:
--reset animations in 0ms to pos 0/0
ActiveAnimations["tunnel0"]:to(0, { VAnimationCurrentPosition = {x = 0, y = 0} })
ActiveAnimations["tunnel1"]:to(0, { VAnimationCurrentPosition = {x = 0, y = 0} })
ActiveAnimations["tunnel2"]:to(0, { VAnimationCurrentPosition = {x = 0, y = 0} })
--randomize a number between 0 and 2
local randomtunnel = math.random(0,2)
--move random tunnel animation to other side of the screen in 500ms (assuming x=2000 is outside the view)
ActiveAnimations["tunnel"..randomtunnel]:to(500, { VAnimationCurrentPosition = {x = 2000, y = 0} })
Actionpart #2: Pause 500ms
Actionpart #3 Jump to Actionpart #1
This should randomly move one animation from tunnel0-2 from 0/0 to 2000/0 in 500ms and looping that stuff.
You should consider that it may looks better if your "real" background is entirely black and your tunnel0-2 animation images are fading into black at the left/right edges, Then you can do a bigger pause, so that the tunnel images appear in greater distance.
------
ADDITIONAL SCENE ACTION to quit all processes which are relevant.
At end of Scene Action:
Hide animation: tunnel0
Hide animation: tunnel1
Hide animation: tunnel2
Quit action: "movebackground"
------
(untested)
kind regards
Sebastian