One of the hardest effects to get working properly, the Two-Way Train goes back and forth between point A and point B when activated by a trigger.
Make your track sector, and place one room at each end. Seperate the track from the rooms using Ceiling Doors ([0,20]
).
Create your train sector in the middle of the track. Tag it [0,31]
. Use the R
key on the train's floors and ceilings if they are supposed to move with the train.
Place three switches in your level: one in each room, and one on the train. If you create a new sector on the train to place a switch on, be sure the new sector is also tagged [0,31]
. Tag all of the switches [ActivationSound,Channel]
.
Place the following sprites on your train: S[Channel+1,30], A[0,Channel]
. The angle of the S
indicates the front of the train (and the direction it will travel when first activated). When you place the S
, keep in mind that it will be the part of the vehicle which overlaps the Locator sprites that will be placed on the track in the next step (I usually move the S
to the center of the Two-Way Train).
Place an L+
sprite at each end of the track. These will be point A and point B. Point A (where the train will stop when it is first activated) has to be tagged [1,1]
. Point B has to be tagged [0,0]
.
Place an A[0,Channel+2]
in the door where the train will stop when it is first activated (point A), and place an A[0,Channel+1]
in the door that the train will stop at the second time it is activated (point B). Make sure to leave the door with the A[0,Channel+2]
closed, and leave the other door with the A[0,Channel+1]
opened.
Now set your start position somewhere near point A (where the door is closed). When you activate the switch, the train will pull up onto the Locator sprite tagged [1,1]
, and the door will open. Hop on the train and hit the switch again, and the train will travel to point B and the second door will open. If your train does not seem to work properly, make sure you've followed all of these steps correctly.
Notes:
[0,31]
[0,Channel+2]
will activate when the train reaches point A
[0,Channel+1]
will activate when the train reaches point B
S