[C++]Era - Text Based Game

Results 1 to 9 of 9
  1. #1
    C:\ WizCoder is offline
    MemberRank
    Aug 2010 Join Date
    JapanLocation
    703Posts

    thumbs up [C++]Era - Text Based Game

    As you can see in the title the game is made with C++. Although its not finish yet and just being updated from its previous versions.

    Era Version 1.0 Features
    • Menu Layout
    • Working keys
    • Registration
      Download Here: Gamefront


    Era Version 2.0 Features
    • Character Classes
    • Levels
    • Story
    • Armour
    • 3 Monsters
    • Colorful Battle stages
      Download Here: Gamefront



    Era Version 2.0 Alternative Source Release

    Alright since I was asked too, here is a alternative but not the original source for V2.0. As the original is being modified and has a more complicated source code feel free to use this one and edit it for yourself.

    Code:
    #include <iostream>
    #include <cstring>
    #include <windows.h>
    
    using namespace std;
    
    
    void WebSite(){
    cout <<"WEBSITE LIST\n\n";
    cout <<"www.Forum.ragezone.com";
    }
    
    void UserMenu(){
        
        
    char choice;
    
    char username[50];
    char blank[50];
    char password[50];
    char name[50];
    char lastname[50];
    char fullname[100];
    char usernamepassword[100];    
        
    int option;
    
    system("cls");    
    cout <<"\t\t\tEra Online Menu.";
    cout <<"\n\n1.Register";
    cout <<"\n2.Play";
    cout <<"\n3.Options";
    cout <<"\n4.Website";
    cout <<"\n5.Credits\n";
    cout <<"6.Quit\n\n";
    cin >> option;
    if ( option = 1 ) {
        system("cls");
    cout <<"-Registration Page-";
    cin.getline( blank, 50 );
    cout <<"\n\nEnter your Username: ";
    cin.getline ( username, 50 );
    cout <<"\n\nEnter a new Password: ";
    cin.getline( password, 50 );
    usernamepassword[0] = '\0';
    strcat ( usernamepassword, username );
    strcat ( usernamepassword, " " );
    strcat ( usernamepassword, password );
    
    system("cls");
    cout <<"Welcome to the new world of Era.";
    cout <<"\n\nWhat is your characters name: ";
    cin.getline( name, 50 );
    if ( strcmp ( name, "era || wizcoder || game" )== 0 )
    cout <<"You cannot use that name.";
    else
    cout <<"\nYour characters name is " << strlen ( name ) << " Letters long.";
    
    cout <<"\n\nWhat is your lastname: ";
    cin.getline( lastname, 50 );
    system("cls");
    fullname[0] = '\0';
    strcat ( fullname, name );
    strcat ( fullname, " " );
    strcat ( fullname, lastname );
    cout <<"Username: " << username << endl;
    cout <<"\nPassword: " << password << endl;
    cout <<"\nAND.\n\n";
    cout <<"Your characters full name is\n\nFirst Name: " << name << "\nLastname: " << lastname << endl;
    cout <<"\n\nTry to write down your username and password to reduce the possibilities of forgetting it.";
    system("pause");
    system("cls");
    
    }
    }
    void Fish(){
        system ( "color 02" );
        cout <<"\t\t\t   YOU VS (FISH)\n\n";
        cout <<"(Fish) - 25 Hitpoints.";
        Sleep(3000);
        cout <<"\nYou - 100 Hitpoints.\n";
        cout <<"You attack (Fish) for 5 hitpoints.\n\n";
        Sleep(3000);
        cout <<"(Fish) has attacked you for 5 hitpoints, and you now have 95.\n\n";
        Sleep(3000);
        cout <<"You used smash and damaged (Fish) for 15 hitpoints and he is left with (5)HP.\n\n";
        Sleep(3000);
        cout <<"(Fish) has attacked you for 8 hitpoints, and you now have (87)HP.\n\n";
        Sleep(3000);
        cout <<"You have attacked (Fish) for 5 hitpoints and he is now dead...\n";
        Sleep(3000);
        cout <<"YOU ARE VICTORIOUS.\n\n";
        system("pause");
        system("cls");
    }
    
    void Shark(){
        system ( "color 03" );
        cout <<"\t\t\t   YOU VS (SHARK)\n\n";
        cout <<"(Shark) - 50 Hitpoints.";
        Sleep(2000);
        cout <<"\nYou - 100 Hitpoints.\n";
        cout <<"You attack (Shark) for 10 hitpoints.\n\n";
        Sleep(3000);
        cout <<"(Shark) has attacked you for 10 hitpoints, and you now have 90.\n\n";
        Sleep(3000);
        cout <<"You used smash and damaged (Shark) for 10 hitpoints and he is left with (30)HP.\n\n";
        Sleep(3000);
        cout <<"(Shark) has attacked you for 5 hitpoints, and you now have (85)HP.\n\n";
        Sleep(3000);
        cout <<"You have attacked (Shark) for 10 hitpoints and is left with 20.\n\n";
        Sleep(3000);
        cout <<"(Shark) has attacked you for 5 hitpoints, and you now have (80)HP.\n\n";
        Sleep(3000);
        cout <<"You have attacked (Shark) for 20 hitpoints and he is now dead...\n\n";
        cout <<"YOU ARE VICTORIOUS.\n\n";
        system("pause");
        system("cls");
    }
    
    
    int main()
    {
    
    char choice;
    
    for (;;) {
     
    do
    {
    
    cout <<"\n\n\t\t\t       ERA ONLINE";
    
    cout <<"\n\n1.Battle";
    cout <<"\n2.Stats";
    cout <<"\n3.Save (Coming Soon)";
    cout <<"\n4.Options (Not Finished)";
    cout <<"\n5.Menu (Working)";
    cout <<"\n6.Quit";
    
    
    cout <<"\n\nSelection: ";
    cin >> choice;
    
    }
    while ( choice < '1' || choice > '6' && choice != '6' );
    if ( choice == '6' ) break;
    
    switch ( choice ) {
    
    case '1' :
        int fish;
        int shark;
        int snake;
        int battle;
        system("cls");
        cout <<"Who would you like to fight?";
        cout <<"\n\n1.Fish";
        cout <<"\n2.Shark";
        cout <<"\n\nBattle: ";
        cin >> battle;
        cin.ignore();
        system("cls");
        
        if ( battle == 1 ) {
            Fish();
        }
        
        else if ( battle == 2 ) {
            Shark();
        }
            
    break;
    
    
    case '2' :
    system("cls");
    cout <<"\t\t\t    Character Stats:";
    cout <<"\n\n\t\t\t\n\t\t\t    Combat Level: 1";
    cout <<"\t\t\t\n\t\t\t    Strength Level: 1";
    cout <<"\t\t\t\n\t\t\t    Attack level: 1:";
    cout <<"\t\t\t\n\t\t\t    Defence level : 1";
    cout <<"\t\t\t\n\t\t\t    Mage Level: 1\n\n";
    cout <<"\t\t\t\n\t\t\t    Hitpoints: 100\n\n";
    cout <<"Press Enter to return\n\n";
    system("pause");
    system("cls");
    break;
    
    case '3' :
    
    break;
    
    case '4' :
    system("cls");
    cout <<"-Background color";
    cout <<"\n-Text color font";
    cout <<"\n-Sound Effects";
    cout <<"\n-Sound Volume";
    cout <<"\n-Texture Quality";
    cout <<"\nNot ready yet so.. Hit enter to return to the main menu.\n";
    system("pause");
    system("cls");
    break;
    
    case '5' :
    UserMenu();
    break;
    
    case '7' :
        
    break;
    
    default :
    break;
    }
    }
    
    int option;
    
    system("cls");
    cout <<"\t\t\tEra Online";
    
    cout <<"\n1.Battle";
    cout <<"\n2.Inventory";
    cout <<"\n3.Options";
    cout <<"\n4.Save";
    cout <<"\n5.Quit";
    cout <<"\n\nOption: ";
    cin >> option;
    if ( option = 1 ) {
        cout <<"hello";
    }
    cin.get();
    }
    I'll be updating this thread as I finish coding each part.
    ALL GAME MIRRORS ARE FOUND ABOVE.
    Last edited by WizCoder; 05-04-11 at 11:03 PM.


  2. #2
    Ass > Tits Lapje is offline
    MemberRank
    Feb 2009 Join Date
    nullLocation
    1,879Posts

    Re: [C++]Era - Text Based Game

    Could I see the source code? o-o. Im curious what you did.

  3. #3
    C:\ WizCoder is offline
    MemberRank
    Aug 2010 Join Date
    JapanLocation
    703Posts

    Re: [C++]Era - Text Based Game

    Quote Originally Posted by Lapje View Post
    Could I see the source code? o-o. Im curious what you did.
    I'll post it soon.

  4. #4
    "Snort Snort" "HEYGUYS!" starkey98 is offline
    MemberRank
    Aug 2009 Join Date
    North CarolinaLocation
    304Posts

    Re: [C++]Era - Text Based Game

    pretty fun. I would love to help develop.

  5. #5
    C:\ WizCoder is offline
    MemberRank
    Aug 2010 Join Date
    JapanLocation
    703Posts

    Re: [C++]Era - Text Based Game

    Update: There you go, a alternate source code as been released.

  6. #6
    I am Dylan. I<3Bass is offline
    MemberRank
    Jun 2010 Join Date
    New YorkLocation
    953Posts

    Re: [C++]Era - Text Based Game

    Nice work Wiz.

  7. #7
    :-) s-p-n is offline
    DeveloperRank
    Jun 2007 Join Date
    Next DoorLocation
    2,098Posts

    Re: [C++]Era - Text Based Game

    Don't use system('cls').. or pretty much system() anything.. or anything from "windows.h"


    I don't want to explain (like the second comment on this thread:) [Look at the fourth or so comment]
    How do I clear screen? - C++ Forum

  8. #8
    1/11/1995 ~ 23/11/2011 rebora2007 is offline
    MemberRank
    Nov 2010 Join Date
    Care much ?Location
    2,346Posts

    Re: [C++]Era - Text Based Game

    try to do things using OOP and classes makes it cleaner and more challenging. But nice work.

  9. #9
    C:\ WizCoder is offline
    MemberRank
    Aug 2010 Join Date
    JapanLocation
    703Posts

    Re: [C++]Era - Text Based Game

    Quote Originally Posted by rebora2007 View Post
    try to do things using OOP and classes makes it cleaner and more challenging. But nice work.
    I was planning to just keep this version just more on the easier coding side and implement more advanced codes during the next version, like you stated ( classes etc ).
    Last edited by WizCoder; 09-04-11 at 06:13 AM.



Advertisement