Subscribe to extremeblueness' Blog        RSS Feed
-----

A Medieval Text Adventure version 0.5

Icon 6 Comments

Poll: A Medieval Text Adventure version 0.5 (2 member(s) have cast votes)

How do you like my text adventure so far?

  1. It's awesome! (0 votes [0%])

    Percentage of vote: 0%

  2. It's good. (0 votes [0%])

    Percentage of vote: 0%

  3. It's O.K. (0 votes [0%])

    Percentage of vote: 0%

  4. It's bad, and needs fixing (2 votes [100%])

    Percentage of vote: 100%

  5. It should be totally trashed. (0 votes [0%])

    Percentage of vote: 0%

Vote Guests cannot vote
Time for an on-topic entry. Well, I've decided to use substrings and a buffered string reader for my text adventure. I haven't implemented my string reader yet, but here's version 0.5 of my text adventure:

public class MedievalTextAdventure
{
    public static void main (String args[])
    {
        System.out.println("loading...");
        boolean NOTE = false, HOUSE = false, TREASURE = false,
                HAMMER = false, FROGS = false, FISH = false,
                FISHINGROD = false, GOLD = false, DOCTOR = false,
                OLDKEY = false, BUTTERFLYNET = false, HOUSE1 = false,
                HOUSE2 = false, HOUSE3 = false, HOUSE4 = false,
                HOUSE5 = false, ABANDONEDHOUSE = false, LAKE1 = false,
                LAKE2 = false, LAKE3 = false, LAKE4 = false,
                LAKE5 = false, LAKE6 = false, DOCTORSHOUSE = false,
                FISHMONGERY = false, gamerunning = true, alive = true,
                LICORICE = true, JEWEL = true, SHIELD = true, WRENCH = true;
        int points = 0;
        int vertical = 4;
        int horizontal = 9;
        String sNOTE = new String("NOTE");
        String sHOUSE = new String("HOUSE");
        String sTREASURE = new String("TREASURE");
        String sHAMMER = new String("HAMMER");
        String sFROGS = new String("FROGS");
        String sFISH = new String("FISH");
        String sFISHINGROD = new String("FISHINGROD");
        String sGOLD = new String("GOLD");
        String sDOCTOR = new String("DOCTOR");
        String sOLDKEY = new String("OLDKEY");
        String sBUTTERFLYNET = new String("BUTTERFLYNET");
        String sABANDONEDHOUSE = new String("ABANDONEDHOUSE");
        String sLAKE = new String("LAKE");
        String sFISHMONGERY = new String("FISHMONGERY");
        String sOLDWOMAN = new String("OLDWOMAN");
        String sWOMAN = new String("WOMAN");
        String sMOTHER = new String("MOTHER");
        String sGUARD = new String("GUARD");
        String sFIELD = new String("FIELD");
        String sPEASANT = new String("PEASANT");
        String sGRASS = new String("GRASS");
        String sHUNGRYPEASANT = new String("HUNGRYPEASANT");
        String sPOORPEASANT = new String("POORPEASANT");
        String sLICORICE = new String("LICORICE");
        String sJEWEL = new String("JEWEL");
        String sWRENCH = new String("VASE");
        String sSHIELD = new String("SHIELD");
        String sPOND = new String("POND");
        String sDIRT = new String("DIRT");
        String sWEST = new String("WEST");
        String sNORTH = new String("NORTH");
        String sEAST = new String("EAST");
        String sSOUTH = new String("SOUTH");
        String sUSE = new String("USE");
        String sTALK = new String("TALK");
        String sGIVE = new String("GIVE");
        String sGO = new String("GO");
        String sJUMP = new String("JUMP");
        String sSEARCH = new String("SEARCH");
        String sUNLOCK = new String("UNLOCK");
        String sENTER = new String("ENTER");
        for ( ; gamerunning == true ; )
        {
            for ( boolean loopcontrol = true ; loopcontrol == true ; loopcontrol = false )
            {
                if ( vertical == 1)
                {
                    if ( horizontal == 1)
                    {
                    }
                    else if ( horizontal == 2)
                    {
                    }
                    else if ( horizontal == 3 )
                    {
                    }
                    else if ( horizontal == 4 )
                    {
                    }
                    else if ( horizontal == 5 )
                    {
                    }
                    else if ( horizontal == 6 )
                    {
                    }
                    else if ( horizontal == 7 )
                    {
                    }
                    else if ( horizontal == 8 )
                    {
                    }
                    else if ( horizontal == 9 )
                    {
                    }
                    else if ( horizontal == 10 )
                    {
                    }
                }
                else if ( vertical == 2)
                {
                    if ( horizontal == 1)
                    {
                    }
                    else if ( horizontal == 2 )
                    {
                    }
                    else if ( horizontal == 3 )
                    {
                    }
                    else if ( horizontal == 4 )
                    {
                    }
                    else if ( horizontal == 5 )
                    {
                    }
                    else if ( horizontal == 6 )
                    {
                    }
                    else if ( horizontal == 7 )
                    {
                    }
                    else if ( horizontal == 8 )
                    {
                    }
                    else if ( horizontal == 9 )
                    {
                    }
                    else if ( horizontal == 10 )
                    {
                    }
                }
                else if ( vertical == 3)
                {
                    if ( horizontal == 1 )
                    {
                    }
                    else if ( horizontal == 2 )
                    {
                    }
                    else if ( horizontal == 3 )
                    {
                    }
                    else if ( horizontal == 4 )
                    {
                    }
                    else if ( horizontal == 5 )
                    {
                    }
                    else if ( horizontal == 6 )
                    {
                    }
                    else if ( horizontal == 7 )
                    {
                    }
                    else if ( horizontal == 8 )
                    {
                    }
                    else if ( horizontal == 9 )
                    {
                    }
                    else if ( horizontal == 10 )
                    {
                    }
                }
                else if ( vertical == 4)
                {
                    if ( horizontal == 1 )
                    {
                    }
                    else if ( horizontal == 2 )
                    {
                    }
                    else if ( horizontal == 3 )
                    {
                    }
                    else if ( horizontal == 4 )
                    {
                    }
                    else if ( horizontal == 5 )
                    {
                    }
                    else if ( horizontal == 6 )
                    {
                    }
                    else if ( horizontal == 7 )
                    {
                    }
                    else if ( horizontal == 8 )
                    {
                    }
                    else if ( horizontal == 9 )
                    {
                    }
                    else if ( horizontal == 10 )
                    {
                    }
                }
                else if ( vertical == 5)
                {
                    if ( horizontal == 1 )
                    {
                    }
                    else if ( horizontal == 2 )
                    {
                    }
                    else if ( horizontal == 3 )
                    {
                    }
                    else if ( horizontal == 4 )
                    {
                    }
                    else if ( horizontal == 5 )
                    {
                    }
                    else if ( horizontal == 6 )
                    {
                    }
                    else if ( horizontal == 7 )
                    {
                    }
                    else if ( horizontal == 8 )
                    {
                    }
                    else if ( horizontal == 9 )
                    {
                    }
                    else if ( horizontal == 10 )
                    {
                    }
                }
                else if ( vertical == 6)
                {
                    if ( horizontal == 1 )
                    {
                    }
                    else if ( horizontal == 2 )
                    {
                    }
                    else if ( horizontal == 3 )
                    {
                    }
                    else if ( horizontal == 4 )
                    {
                    }
                    else if ( horizontal == 5 )
                    {
                    }
                    else if ( horizontal == 6 )
                    {
                    }
                    else if ( horizontal == 7 )
                    {
                    }
                    else if ( horizontal == 8 )
                    {
                    }
                    else if ( horizontal == 9 )
                    {
                    }
                    else if ( horizontal == 10 )
                    {
                    }
                }
                else if ( vertical == 7)
                {
                    if ( horizontal == 1 )
                    {
                    }
                    else if ( horizontal == 2 )
                    {
                    }
                    else if ( horizontal == 3 )
                    {
                    }
                    else if ( horizontal == 4 )
                    {
                    }
                    else if ( horizontal == 5 )
                    {
                    }
                    else if ( horizontal == 6 )
                    {
                    }
                    else if ( horizontal == 7 )
                    {
                    }
                    else if ( horizontal == 8 )
                    {
                    }
                    else if ( horizontal == 9 )
                    {
                    }
                    else if ( horizontal == 10 )
                    {
                    }
                }
            }
        }
    }
}

6 Comments On This Entry

Page 1 of 1

modi123_1 Icon

06 November 2012 - 08:02 AM
Wow... one word - classes! Object all that up! Also, any screen shots?
1

extremeblueness Icon

06 November 2012 - 05:20 PM
Considering that it's not functional yet (no user input as of yet), I cannot provide you a screenshot. Will provide one once I get even minimal functionality.

And what exactly would be the point of multiple classes here? I'm willing to listen, but I'm curious.
0

fromTheSprawl Icon

07 November 2012 - 02:15 AM
With classes, you can divide up your game to modular parts. You can theoretically do a Character class for starters, then maybe Monsters for the enemies, an Inventory to hold an Item class, the list goes on and on.
1

extremeblueness Icon

07 November 2012 - 05:31 PM
I see your point, but more or less the only thing that would be helpful is an inventory class, since its a basic text adventure. There are no enemies, and the only way to die so far is to jump in the lake.

I promised a screenshot once it had minimal functionality, so here's your screenshot:

http://tinypic.com/r/2gy0w46/6
0

fromTheSprawl Icon

07 November 2012 - 05:51 PM
How about each scenarios? Locations, maybe? Don't worry bud, once you realize the beauty of OOP you'll never look back. ^^
0

extremeblueness Icon

07 November 2012 - 06:01 PM
I have a network of coordinates and if-else-if ladders for coordinates, using just two variables.

Because I don't really know classes very well compared to variables, I'm gonna stick to variables unless multiple classes saves me very much work.
0
Page 1 of 1

Trackbacks for this entry [ Trackback URL ]

There are no Trackbacks for this entry

October 2014

S M T W T F S
   1234
567891011
12131415161718
192021 22 232425
262728293031 

Tags

    Recent Entries

    Recent Comments

    Search My Blog

    0 user(s) viewing

    0 Guests
    0 member(s)
    0 anonymous member(s)

    Categories