Train effect.

How can I add an enemy that has a fixed position on the screen and runs in a direction continuously, such as a train or similar ¿?
Thanks.
 
:)  hello friend,  The best option is this :

name trein1
nolife 1
type none
shadow 0
animationscript data/scripts/script.c

anim spawn
@script
void self = getlocalvar("self");
if ((getentityproperty(self, "direction")==1)&&(frame == 1)){
changeentityproperty(self, "velocity", -3, 0, 0);
}
@end_script
loop 0
delay 13
offset 1 98
bbox 0 0 0 0
Attack1  0
sound  Data/SOUNDS/train1.wav
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/trein3.gif
frame data/chars/misc/




 
an enemy that has a fixed position on the screen and runs in a direction continuously, such as a train or similar ¿?

I'm not sure what you want here. Fixed position yet runs continuously? can you explain better?

Anyways, there are many ways to make train effect from train which passes by showing its car one by one until last car to train which comes then stops
 
Goresickness said:
Yes, the idea is to make a fixed-position train wagon in Loop 1 that hits those on the screen, it's for a subway screen that I have in mind.

If the train isn't animated besides the scrolling by effect, then fglayer or bglayer is what you really want.

DC
 
My suggestion is to make a train spawner entity which spawns train cars one by one until all cars are spawned. To prevent the spawner and cars from being removed by offscreen kill, simply set offscreenkill 5000
 
Back
Top Bottom