DEV Community

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

Posted on

3 2

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! βš”πŸ—ΊοΈ


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 adventure…

Top comments (0)

Great read:

Is it Time to go Back to the Monolith?

History repeats itself. Everything old is new again and I’ve been around long enough to see ideas discarded, rediscovered and return triumphantly to overtake the fad. In recent years SQL has made a tremendous comeback from the dead. We love relational databases all over again. I think the Monolith will have its space odyssey moment again. Microservices and serverless are trends pushed by the cloud vendors, designed to sell us more cloud computing resources.

Microservices make very little sense financially for most use cases. Yes, they can ramp down. But when they scale up, they pay the costs in dividends. The increased observability costs alone line the pockets of the β€œbig cloud” vendors.

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay