DEV Community

Cover image for Building A Text Based Adventure Game with Java βš”πŸ—Ί
Abhishek Keshri
Abhishek Keshri

Posted on

Building A Text Based Adventure Game with Java βš”πŸ—Ί

Adventure TUI

Adventuring from the Terminal! βš”πŸ—ΊοΈ

What is this

Adventure TUI is a text adventure game, where you can explore different world right from you terminal.

You can add your own adventures too, see below to learn how.

Inspiration

I have spent so many nights on text-based adventure games, this is my tribute to Will Crowther's original "Adventure" from early 1970s.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of java

Getting adventure-tui

To get adventure-tui, follow these steps:

git clone https://github.com/2kabhishek/adventure-tui
cd adventure-tui
Enter fullscreen mode Exit fullscreen mode

Using adventure-tui

After cloning you can use VS Code (with Java extentsions), or any other editor/IDE to run this.

For running it from the command line, follow these steps

cd src/
# Compile Adventure.java
javac Adventure.java
# Run Adventure.java
java Adventure
Enter fullscreen mode Exit fullscreen mode

Once you run the game you will be asked to choose an adventure, You can choose between Crowther, Small or a custom adventure you added.

If you see errors while running from the Terminal, you can edit the DATA_PATH variable in src/Adventure.java

How it was built

adventure-tui was built using java and lots of imagination!

Challenges faced

  • Building out the Abstractions was challenging
  • Breaking the problem into smaller pieces was daunting in the begining

What I learned

While building adventure-tui I learned about

  • How to build abstractions using OOP
  • Efficient use of txt files for data storage
  • Building Text adventure games is fun!

What's next

Maybe add a new game, just have to add a new rooms and objects file!

Hit the ⭐ button if you found this useful.

More Info

Demo Video

GitHub logo 2KAbhishek / adventure-tui

Adventuring from the Terminal! βš”πŸ—ΊοΈ

Adventure TUI

License People Stars Forks Watches Last Updated

Adventuring from the Terminal! βš”πŸ—ΊοΈ

adventure-tui Demo
adventure-tui screenshot

What is this

Adventure TUI is a text adventure game, where you can explore different world right from you terminal.

You can add your own adventures too, see below to learn how.

Inspiration

I have spent so many nights on text-based adventure games, this is my tribute to Will Crowther's original "Adventure" from early 1970s.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have installed the latest version of java

Getting adventure-tui

To get adventure-tui, follow these steps:

git clone https://github.com/2kabhishek/adventure-tui
cd adventure-tui
Enter fullscreen mode Exit fullscreen mode

Using adventure-tui

After cloning you can use VS Code (with Java extentsions), or any other editor/IDE to run this.

For running it from the command line, follow these steps

cd src/
# Compile Adventure.java
javac Adventure.java
# Run Adventure.java
java Adventure

Once you run the game you will be asked to choose an…

Top comments (0)