Results 1 to 3 of 3
  1. #1
    N0VA is offline Member
    Join Date
    Dec 2010
    Rep Power

    Default [help] text game

    Well im currently working on a text based game ive been working on it for like 3 mins now im trying to get some commands working... and im un-sure what to do

    class main {

    public static void main(String[] args) {
    System.out.println("Welcome to the texted based game");
    System.out.println("Pleae pick you Character");


  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    well, text games usually have a "map". I would start by designing a world of rooms and how they connect together, and then figuring out a way to model a room and the transitions between room. for example, to move north, south, east, west. we might have
    an array of rooms, where the room object contains properties to indicate the room that is above, below, or beside the current room. which in the simplest case can be the index into this array for the next room object to go to.

    then there is likely some kind of array of objects, which could be a class that contains the object information, description, and the current room where it can be found, unless the object is currently in the player's inventory, which could also be an array of objects within the player object.

    the player object would likely have attributes like stamina, defense, agility, mana, and such that could be set from your main setup questions for what kind of race or classification they wanted to be. though this setup loop would be the entry point on start of new game. once the game is running usually there is a kind of generic game loop that would run for the lifetime of the game, as long as the player is alive, that might check the current room, display some status information, prompt for input. then wait for user to enter a command. then parse the command and map to your verbs database, depedning on if the command was not understood, return to ask the question again. Once a valid command has been understood, act on the command, perform the operation to manipulate the state of the environment such as moving to the next room, picking up or dropping the object., and then repeat.

  3. #3
    N0VA is offline Member
    Join Date
    Dec 2010
    Rep Power


    wow, is it that hard to make a simple texted based game like they pick options ect ect

Similar Threads

  1. Replies: 0
    Last Post: 12-09-2010, 06:56 PM
  2. Replies: 2
    Last Post: 08-05-2010, 05:49 AM
  3. Simple Text race game
    By Inf1nity in forum New To Java
    Replies: 2
    Last Post: 03-16-2009, 04:46 PM
  4. creating a text based game
    By Phobos0001 in forum New To Java
    Replies: 1
    Last Post: 02-12-2008, 05:35 PM
  5. Help with java text game
    By silvia in forum New To Java
    Replies: 6
    Last Post: 07-27-2007, 07:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts