__ ______ _
/ / ___/_ __/________ _(_)___
/ / / _ \/ / / ___/ __ `/ / __ \
/ /___/ __/ / / / / /_/ / / / / /
/_____/\___/_/ /_/ \__,_/_/_/ /_/
The Letter Train Simulator
(C) 2006-2023 Antonio Vazquez Araujo
Letrain is a train simulator made for the ascii terminal
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
LeTrain is a train simulator that can be played on any ascii terminal. It consists of creating tracks and stations along a virtually infinite map, creating trains and earning money by carrying passengers between them. It will be more profitable the farther apart they are.
**Warning This is a preliminary version. There are still many things that are pending. At the moment it works but one day it will be much better than it is now.
- Java OpenJdk 17
- Lanterna library
- Java JDK 17
- Apache Maven
To install it
- Clone it
git clone https://github.com/antoniovazquezaraujo/letrain.git
- Install it
mvn clean install
- Run it
java -jar target/JLeTrain-<version>-jar-with-dependencies.jar
This is the general appearance of LeTrain. On the map, randomly generated for each game, you can see water areas in blue, mountain areas in orange and the dark area which is normal ground. Building tracks across normal ground is fast and cheap, however, creating bridges to cross lakes or drilling tunnels to cross mountains is slow and expensive.
At the bottom you can see the menu, where the different game modes are selected, which will allow us to create tracks, build wagons and locomotives, turnouts, traffic lights and programmable sensors.
Each option is activated with the letter that appears in a different color, for example, to enter "drive" mode use the "d" key.
To create tracks on the map just select the "rails" mode and move with the cursor. Holding down the shift key will generate tracks and with control you can delete them. Turnouts and crossovers are created automatically.
Once we have tracks, we just have to go to "trains" mode, which will allow us to create wagons (any lower case letter) and locomotives (any upper case letter). To exit this mode you need to press Enter.
When creating wagons and locomotives they do not form a train, they are unlinked. To create a train you need to have the locomotive next to them and select "link" and then choose the direction to look for wagons. Then, with the space bar you will link all the wagons that are together. That will be a train. To unlink wagons, select "unlink", select the direction and move forward or backward to the wagon where you want to split. Then use the space bar
If you leave the page with the cursor, you will see that the map continues. There is no limit but memory.
If you find that the cursor is moving too slowly, you can type any number before using it, and each step will be added to that number of steps. For example, if you type 30, each time you press the advance key, 31 steps will be advanced, the default step plus the other 30. (If you are a Vim user (cheers Bram, wherever you are) you will be familiar with this kind of quantifier). To return to de default quantifier, just use the space bar.
On any rail you can install a sensor if you want things to happen when a train passes over it, e.g. change a turnout, decelerate the train, change the state of a traffic light, etc. LeTrain's mini programming language is super simple, you won't have to learn almost anything.
You can save the LeTrain status in a file at any time. You can also save the sensor programming in another file. The latter is a simple plain text file, which you can edit with your favorite editor or with the basic LeTrain editor.
You can use the console zoom keys to see more or less scenery when you need it. They are usually assigned to ctrl-+ and ctrl--. You can also use the PgUp and PgDown keys to move up and down pages or ctrl+PgUp or ctrl+PgDown to move across pages horizontally. It is easy to get lost, to go back just switch to "drive" mode and select with the arrows the next or previous locomotive. The same with crossovers, stations, sensors, etc. You can also select objects by their number, just type the number and the object will be selected.
In effect: if two trains approach each other at a speed greater than 1, a catastrophe will occur. You will lose the money you have spent to create them. The money is the number at the bottom right of the menu. It decreases when trains move, and when tracks are built. It increases when trains pick up passengers at stations.
For more examples, please refer to the Documentation
There are many things to do, but for the moment it works.
- Add sound
- Add freight trains
- Add cities
- Add missions
- Improve gameplay
- Improve menu
- User manual
- Much more
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Antonio Vazquez Araujo
Twitter/X - @avaraujo
GMail - antoniovazquezaraujo@gmail.com
Project Link: https://github.com/antoniovazquezaraujo/letrain