Text Adventure Game Using Java



In a text adventure game, the central character is the Adventurer, which is an object representing the human player. You need this object because you need to keep track of where the player is, what the player is holding, and anything else you need.


The adventurer plays the game by typing in commands. Commands consist of one or

two words (more than two is too much work).


There are several commands that are found in nearly every game:


Go direction Moves the Adventurer from one Room to another. The direction is usually one of "north", "south", "east", "west", and sometimes "up" and "down." Occasionally other directions are used, such as "northwest" or "sideways". Directions can usually be abbreviated, such as "n" for north, "u" for up, etc. Many games allow the verb "go" to be omitted, so "n" is short for "go north".


Look Gives a full description of the Room that the Adventurer is in.


Look thing Gives a full description of the named Thing. For this command to work, the Adventurer must either be holding the named Thing or at least be in the same room with it. Looking at a thing sometimes reveals surprising details about it.

Take thing Picks up a Thing that is in the same room as the Adventurer. The game might contain Things that cannot be picked up, such as a vending machine, or a cave painting.

drop thing Puts down a Thing that the player is holding. Usually this means that the Thing is put into the Room that the Adventurer is in, but there may be exceptions (if the Adventurer is on a tightrope, for example), depending on the game.


Here is a command that is occasionally available:


• use thing -- This is a very general command, whose meaning depends on the Thing. Using a gun is very different from using a key, or a chocolate. Most often, though, games require more specific verbs: shoot gun, open safe, eat chocolate. Depending on your game and specific items, this may or may not be needed.

Every command should get a response. If there is nothing much to say, the response

can be simply OK. If the command can't be done, the player should be told, for instance, “I don't understand” or “You can't go that way.” When the player moves to a new location, the response should usually be a full description of the newly entered Room.


Program Details

An adventure game consists of:


(1) A TextAdventure class. This class:

  • Contains the main method used to start the game.

  • Talks to the AdventureModel and to the Adventurer classes, as needed.

(2) An AdventureModel class. This class:

  • Creates the Rooms, the Things, and the Adventurer.

  • Connects the Rooms with "paths" to other Rooms.

  • Places Things in the Rooms.

  • Places the Adventurer in some Room.

  • Accepts commands from the player, and executes them.

As commands are entered, they should be copied to the main text area.

The method that executes commands should return a String to be displayed in the main text area.


(3) An Adventurer (the human player).

An adventurer has:

  • A location (some room).

  • An inventory (the things being carried). When the player executes the “take thing” command, the item should be added to the inventory.

An adventurer can:

  • Move from room to room.

  • Carry a number of objects.

  • Pick up, drop, look at, and use various objects.

(4) Some number of Rooms. A room has:

  • A name.

  • A description, possibly several sentences long.

  • Contents: the things in the room.

  • Exits: paths to other rooms (usually some of north, south, east, and west).

Some number of Things. A thing has:

  • o A name § If some of your Things have multi-word names, such as "firebreathing dragon" or "that thing that your aunt gave you that you don't know what it is", then you might want to give your Things both a full name and a one-word name.\

  • A description, to be shown when the adventurer "looks" at it.

  • One or more methods for using the Thing. You can have a multipurpose use verb, or you can make up your own verbs (for instance, drink water or pour water), which determines what the thing does when the adventurer tries to use it.

  • For simplicity, we will say that the adventurer can only use things being carried (in the inventory)

  • Whether "using" a thing does anything or not (or exactly what it does) can depend on what room it is in, what other things are in the room or in the inventory, or any other conditions you can think of.

Your assignment is to write an adventure game with your group. It should have:


- A general location (battlefield, outer space, etc.)

- At least 10 rooms

- An inventory for the player to store items

- At least 3 examples of Inheritance

- At least 2 examples of Overridden Methods

- At least 1 example of Polymorphism (note it in a code comment so I can see

you understand it)

- Be sure only the minimum methods are public; most of your methods and

variables should be private

- README.txt - This is where you will describe the available commands and anything else necessary for the user to play your game.


The theme of the game, and the goal of the game, is up to you.

So that your adventure game is not too difficult to grade, please:

  • Don't let the player "die" or otherwise get into a situation from which there is no possibility of winning the game.

  • Include a walkthrough (in a file named README.txt) to tell me how to play your game to successful completion.


Feel free to contact us and take the advantages of Java assignment help services offered by us. We are the best assignment writing service provider and to solve all your academic worries. You can easily connect with us through phone, e-mail, or live chat. You can contact us anytime; our experts are always available for your help. Besides this, We will also provide CONSULTANCY for your app for FREE!

so, if you are still reading this and have an app idea, drop us a message, we can surely talk and discuss your project and get things done!. You are just one step away to get it done.



If you have project or assignment files, You can send at contact@codersarts.com directly



72 views0 comments

Recent Posts

See All