You control a cursor which can click on each of the junctions, toggling their positions. When trains reach a junction which is not set in a direction they can move through, they will stop until you move it. When they reach the wrong station they simply reverse and continue. If two trains make contact, they are lost, and a penalty is accrued.
Edit View History