My Game

This is a discussion on My Game within the C++ Programming forums, part of the General Programming Boards category; im am new to c++ (im learning it for about 3weeks) but i made a game and i wanted feedbak, ...

  1. #1
    Dragoon Lover wyvern's Avatar
    Join Date
    Jul 2005
    Location
    dragooncity
    Posts
    28

    My Game

    im am new to c++ (im learning it for about 3weeks) but i made a game and i wanted feedbak, newways i can improve it, and teach me using local variables.
    Code:
    #include <cstdlib>
    #include <fstream>
    #include <iostream>
    
    using namespace std;
    
        int lvls = 0; 
        char cha[5];
        char load[153];
        char namew[50];
        char namek[50];
        char namee[50];
        char namet[50];
        char nameh[50];
        int money;
        int exp;
        int lvl;
        int lp;
        int hitpoints;
        int agility;
        int energy;
        int health;
        int Ehitpoints;
        int Eagility;
        int Eenergy;
        int Ehealth;
        int Points;
        char enemych[23];
        bool hw = 0;
        
        
    struct chartype
    {
           int hitpoints;
           int agility;
           int energy;
           int health;
           int cexp;
           int clvl;
           int cpoints;
           int cmoney;
    };
        chartype wizard;
        
        chartype knight;
        
        chartype elf;
        
        chartype thief;
        
        chartype holy;
     
        chartype esk;
        
        chartype ek;
        
        chartype ed;
        
        chartype ew;
        
        chartype gl;
        
        chartype sw;
    
        
              
        
    inline void Eatk()
    {
           int meshif = rand()% 11;
           
           if (meshif <= 7 )
           {
            health -= Ehitpoints;
           }
           else if ( meshif > 7 )
           {
            cout<<"-------------- Enemy Spell ------------"<<endl;
            health -= Eenergy;
           }
    }
    
    
    inline void game()
    {
               cout<<"START"<<endl<<endl;
        
        while (1)
        {
        cout<<"Your HP = "<<health<<"       Enemy HP = "<<Ehealth<<endl;
        cout<<"Chose: [A]tack  [H]eal [S]pell [R]un(if you are a coward)"<<endl;
        
        char choice[1];
        
        cin>> choice;
        
        if ( strcmp ( choice, "a")==0)
        {
             int randatk = rand()% 11;
             
             if (randatk <= 3)
             {
                 cout<<"---------------- miss ----------------"<<endl;
             }
             else if ( randatk >3 && randatk != 10 )
             {
             Ehealth -= hitpoints;
             }
             
             else if ( randatk ==10 )
             {
                  cout<<"-------------- 2X DMG --------------"<<endl;
                  Ehealth -= hitpoints;
                  Ehealth -= hitpoints;
             }
             
             int randatke = rand()% 11;
             
             if (randatke <=3)
             {
                 cout<<"------------- enemy miss -------------"<<endl;
             }
             else if ( randatke >3 && randatke !=10 )
             {
              Eatk();
             }
             else if ( randatke ==10) 
             {
                  cout<<"-------------- 2X DMG --------------"<<endl; 
                  Eatk();
                  Eatk();
             }
        }
        else if ( strcmp ( choice, "h")==0)
        {
             int heal = rand() % 2;
             
             if (heal == 1){  
             health += 40;
             }
             else 
             {
                  cout<<"-------------- Heal miss --------------"<<endl;
             }
        Eatk();
             
        }
        else if ( strcmp ( choice, "s")==0)
        {
             int randspell = rand()% 11;
             
             if (randspell <= 4)
             {
                 cout<<"---------------- miss ----------------"<<endl;
             }
             else if ( randspell >4 && randspell != 10)
             {
             Ehealth -= energy;
             }
             else if ( randspell ==10 )
             {
                  cout<<"-------------- 2X DMG --------------"<<endl;
                  Ehealth -= energy;
                  Ehealth -= energy;
             }
             
             int randspe = rand()% 11;
             
             if (randspe <= 4)
             {
                 cout<<"------------- enemy miss -------------"<<endl;
             }
             else if ( randspe >4 && randspe !=10 )
             {
              Eatk();
             }   
             else if ( randspe ==10 )
             {
                  cout<<"------------ 2X DMG ENEMY ------------"<<endl;
                  Eatk();
                  Eatk();
             }
        }
        
        int run= rand()% 11;
        
        if ( strcmp ( choice, "r")==0 && strcmp ( load,"t" )!=0 )  
        {
             if ( run <= 4 )
             {
             cout<<"Bye, Bye... CHICKEN"<<endl;
             cin.get();
             break;
             }
             else if ( run > 4 )
             {
                 cout<<"Can't Escape."<<endl<<endl;
                 Eatk();
             }
             
        }
        if ( strcmp ( choice, "r")==0 && strcmp ( load,"t" )==0 )
        {
             if (run <=6 )
             {
             cout<<"Bye, Bye... CHICKEN"<<endl;
             cin.get();
             break;
             }
             else
             {
                 cout<<"Can't Escape."<<endl<<endl;
                 Eatk();
             }
        }
        
        if ( health <= 0 )
        {
             cout<<"Your HP = "<<health<<"       Enemy HP = "<<Ehealth<<endl;
             cout<<"You Lost"<<endl<<endl;
             if ( strcmp ( load, "w") ==0 )
             {
                  ifstream hpts ( "wizard_health.dll" );
                  hpts>>health;
                  hpts.close();
             }
             if ( strcmp ( load, "k") ==0 )
             {
                  ifstream hptsa ( "knight_health.dll" );
                  hptsa>>health;
                  hptsa.close();
             }
             if ( strcmp ( load, "e") ==0 )
             {
                  ifstream hptsb ( "elf_health.dll" );
                  hptsb>>health;
                  hptsb.close();
             }
             if ( strcmp ( load, "t") ==0 )
             {
                  ifstream hptsc ( "thief_health.dll" );
                  hptsc>>health;
                  hptsc.close();
             }
             if ( strcmp ( load, "h") ==0 )
             {
                  ifstream hptsd ( "holy_health.dll" );
                  hptsd>>health;
                  hptsd.close();
             }
             break;
        }
        else if ( Ehealth <= 0 )
        {
             cout<<"Your HP = "<<health<<"       Enemy HP = "<<Ehealth<<endl;
             cout<<"You win"<<endl<<endl;
             Points++;
             if ( strcmp ( enemych, "s")==0)
             {
                  exp+= 100;
                  money+= 25;
             }
             else if ( strcmp ( enemych, "k")==0)
             {
                  exp+= 200;
                  money+= 50;
             }
             else if ( strcmp ( enemych, "d")==0)
             {
                  exp+= 300;
                  money+= 100;
             }
             else if ( strcmp ( enemych, "w")==0)
             {
                  exp+= 500;
                  money+= 150;
             }
             else if ( strcmp ( enemych, "g")==0)
             {
                  exp+= 700;
                  money += 250;
             }
             else if ( strcmp ( enemych, "s")==0)
             {
                  exp+= 1000;
                  money += 350;
             }
             
    
             if ( exp <= 500 )
             {
                  lvl = 1;
                  lvls = 1;
             }
             else if (exp >500 && exp <= 1400 && lvls ==1 )
             {
                   lvl = 2;
                   hitpoints += 10;
                   energy += 10;
                   lvls = 2 ;
             }
             else if (exp >1400 && exp <= 2600 && lvls ==2)
             {
                          lvl = 3;
                          hitpoints += 20;
                          energy += 20;
                          lvls = 3;
             }
             else if (exp >2600 && exp <= 3100 && lvls ==3)
             {
                          lvl = 4;
                          hitpoints += 30;
                          energy += 30;
                          lvls++;
             }
             else if (exp >3100 && exp <= 4000 && lvls ==4)
             {
                          lvl = 5;
                          hitpoints += 50;
                          energy += 50;
                          lvls++;
             }
             else if (exp >4000 && exp <= 4900 && lvls ==5)
             {
                          lvl = 6;
                          hitpoints += 60;
                          energy += 60;
                          lvls++;
             }
             else if (exp >4900 && exp <= 5800 && lvls ==6)
             {
                          lvl = 7;
                          hitpoints += 70;
                          energy += 70;
                          lvls++;
             }
             else if (exp >5800 && exp <= 6700 && lvls ==7)
             {
                          lvl = 8;
                          hitpoints += 80;
                          energy += 80;
                          lvls++;
             }
             else if (exp >6700 && exp <= 7600 && lvls ==8)
             {
                          lvl = 9;
                          hitpoints += 90;
                          energy += 90;
                          lvls++;
             }
             else if (exp >7600 && exp <= 8500 && lvls ==9)
             {
                          lvl = 10;
                          hitpoints += 100;
                          energy += 100;
                          lvls++;
             }
             else if (exp >8500 && exp <= 9400 && lvls ==10) 
             {
                          lvl = 11;
                          hitpoints += 110;
                          energy += 110;
                          lvls++;
             }
             else if (exp >9400 && exp <= 10300 && lvls ==11)
             {
                          lvl = 12;
                          hitpoints += 120;
                          energy += 120;
                          lvls++;
             }
             else if (exp >10300 && exp <= 11200 && lvls ==12)
             {
                          lvl = 13;
                          hitpoints += 130;
                          energy += 130;
                          lvls++;
             }
             else if (exp >11200 && exp <= 12000 && lvls ==13)
             {
                          lvl = 14;
                          hitpoints += 140;
                          energy += 140;
                          lvls++;
             }
             else if (exp >12000 && exp <= 13500 && lvls ==14)
             {
                          lvl = 15;
                          hitpoints += 150;
                          energy += 150;
                          lvls++;
             }
             else if (exp >13500 && exp <= 15000 && lvls ==15)
             {
                          lvl = 16;
                          hitpoints += 160;
                          energy += 160;
                          lvls++;
             }
             else if (exp >15000 && exp <= 16500 && lvls ==16)
             {
                          lvl = 17;
                          hitpoints += 170;
                          energy += 170;
                          lvls++;
             }
             else if (exp >16500 && exp <= 18000 && lvls ==17)
             {
                          lvl = 18;
                          hitpoints += 180;
                          energy += 180;
                          lvls++;
             }
             else if (exp >18000 && exp <= 20000 && lvls ==18)
             {
                          lvl = 19;
                          hitpoints += 190;
                          energy += 190;
                          lvls++;
             }
             else if (exp >20000 && lvls ==19)
             {
                          lvl = 20;
                          hitpoints += 200;
                          energy += 200;
                          lvls++;
                          hw++; 
                          
                          ifstream hwa ( "hw.dll" );
                          hwa>>hw;
                          hwa.close();
             }
             
             if ( strcmp ( load, "w") ==0)
             {
             ofstream a_file ( "wizard_points.dll", ios::trunc );
             a_file<<Points;
             a_file.close();
             ofstream o_file ( "wizard_money.dll", ios::trunc );
             o_file<<money;
             o_file.close();
             ofstream ov_file ( "wizard_lvl.dll", ios::trunc );
             ov_file<<lvl;
             ov_file.close();
             ofstream ex_file ( "wizard_exp.dll", ios::trunc );
             ex_file<<exp;
             ex_file.close();
             ofstream hpt_file ( "wizard_hitpoints.dll", ios::trunc );
             hpt_file<<hitpoints;
             hpt_file.close();
             ifstream hpts ( "wizard_health.dll" );
             hpts>>health;
             hpts.close();
             }
             else if ( strcmp ( load, "k") ==0)
             {
             ofstream a_file ( "knight_points.dll", ios::trunc );
             a_file<<Points;
             a_file.close();
             ofstream o_file ( "knight_money.dll", ios::trunc );
             o_file<<money;
             o_file.close();
             ofstream ov_file ( "knight_lvl.dll", ios::trunc );
             ov_file<<lvl;
             ov_file.close();
             ofstream ex_file ( "knight_exp.dll", ios::trunc );
             ex_file<<exp;
             ex_file.close();
             ofstream hpt_file ( "knight_hitpoints.dll", ios::trunc );
             hpt_file<<hitpoints;
             hpt_file.close();
             ifstream hpts ( "knight_health.dll" );
             hpts>>health;
             hpts.close();
             }
             else if ( strcmp ( load, "e") ==0)
             {
             ofstream a_file ( "elf_points.dll", ios::trunc );
             a_file<<Points;
             a_file.close();
             ofstream o_file ( "elf_money.dll", ios::trunc );
             o_file<<money;
             o_file.close();
             ofstream ov_file ( "elf_lvl.dll", ios::trunc );
             ov_file<<lvl;
             ov_file.close();
             ofstream ex_file ( "elf_exp.dll", ios::trunc );
             ex_file<<exp;
             ex_file.close();
             ofstream hpt_file ( "elf_hitpoints.dll", ios::trunc );
             hpt_file<<hitpoints;
             hpt_file.close();
             ifstream hpts ( "elf_health.dll" );
             hpts>>health;
             hpts.close();
             }
             else if ( strcmp ( load, "t") ==0)
             {
             ofstream a_file ( "thief_points.dll", ios::trunc );
             a_file<<Points;
             a_file.close();
             ofstream o_file ( "thief_money.dll", ios::trunc );
             o_file<<money;
             o_file.close();
             ofstream ov_file ( "thief_lvl.dll", ios::trunc );
             ov_file<<lvl;
             ov_file.close();
             ofstream ex_file ( "thief_exp.dll", ios::trunc );
             ex_file<<exp;
             ex_file.close();
             ofstream hpt_file ( "thief_hitpoints.dll", ios::trunc );
             hpt_file<<hitpoints;
             hpt_file.close();
             ifstream hpts ( "thief_health.dll" );
             hpts>>health;
             hpts.close();
             }
             else if ( strcmp ( load, "h") ==0)
             {
             ofstream a_file ( "holy_points.dll", ios::trunc );
             a_file<<Points;
             a_file.close();
             ofstream o_file ( "holy_money.dll", ios::trunc );
             o_file<<money;
             o_file.close();
             ofstream ov_file ( "holy_lvl.dll", ios::trunc );
             ov_file<<lvl;
             ov_file.close();
             ofstream ex_file ( "holy_exp.dll", ios::trunc );
             ex_file<<exp;
             ex_file.close();
             ofstream hpt_file ( "holy_hitpoints.dll", ios::trunc );
             hpt_file<<hitpoints;
             hpt_file.close();
             ifstream hpts ( "holy_health.dll" );
             hpts>>health;
             hpts.close();
             }
             ofstream l2 ( "l2.bmp" );
             l2<<lvls;
             l2.close();
             
             break;
        }
        
    }  
    }
    
    inline void menu()
    {
           while (1)
           {
           cout<<endl<<"[P]rocede to Battle"<<endl;
           cout<<"[S]hop"<<endl;
           cout<<"[I]nfo"<<endl;
           cout<<"[E]xit"<<endl;
           
           char menu[254];
           cin>>menu;
           
           if (strcmp ( menu, "p")==0)
           {
                      while ( 1 )
             {
             cout<<"Chose ur kind of enemy:"<<endl;
             cout<<"[S]ingle knight     [K]night"<<endl;
             cout<<"[D]ragoon           [W]yvern"<<endl;
             cout<<"[G]olem             [Si]lver Wyvern"<<endl;
             
             cin>>enemych;
             
             if ( strcmp ( enemych, "s")==0)
             {
                   esk.agility = 10;
                   esk.energy = 5;
                   esk.health = 150;
                   esk.hitpoints = 20;
                   
                   Ehitpoints = esk.hitpoints;
                   Eagility = esk.agility;
                   Eenergy = esk.energy;
                   Ehealth = esk.health;
                   
                   game();
                   break;
             }
             else if ( strcmp ( enemych, "k")==0 && Points >= 10)
             {
                     ek.agility = 10;
                     ek.energy = 5;
                     ek.health = 200;
                     ek.hitpoints = 30;
                     
                   Ehitpoints = ek.hitpoints;
                   Eagility = ek.agility;
                   Eenergy = ek.energy;
                   Ehealth = ek.health;
                   
                     game();
                     break;
             }
             else if ( strcmp ( enemych, "k")==0 && Points < 10)
             { 
                 cout<<"Not enough points"<<endl;
                 cin.get(); 
             }
             
             else if ( strcmp ( enemych, "d")==0 && Points >= 20 )
             {
                      ed.agility = 20;
                      ed.energy = 20;
                      ed.health = 300;
                      ed.hitpoints = 40;
                      
                      Ehitpoints = ed.hitpoints;
                      Eagility = ed.agility;
                      Eenergy = ed.energy;
                      Ehealth = ed.health;
                   
                      game();
                      break;
             }
             else if ( strcmp ( enemych, "d")==0 && Points < 20)
             { 
              cout<<"Not enough points"<<endl;
                    cin.get(); 
             }
             else if ( strcmp ( enemych, "w")==0 && Points >= 50 )
             {
                      ew.agility = 30;
                      ew.energy = 50;
                      ew.health = 400;
                      ew.hitpoints = 40;
                      
                   Ehitpoints = ew.hitpoints;
                   Eagility = ew.agility;
                   Eenergy = ew.energy;
                   Ehealth = ew.health;
                   
                      game();
                      break;
             }
             else if ( strcmp ( enemych, "w")==0 && Points < 50 )
             { 
                  cout<<"Not enough points"<<endl<<endl; cin.get(); 
             }
    
             else if ( strcmp ( enemych, "g")==0 && Points >= 70 )
             {
                      gl.agility = 30;
                      gl.energy = 80;
                      gl.health = 650;
                      gl.hitpoints = 90;
                      
                   Ehitpoints = gl.hitpoints;
                   Eagility = gl.agility;
                   Eenergy = gl.energy;
                   Ehealth = gl.health;
                   
                      game();
                      break;
             }
             else if ( strcmp ( enemych, "g")==0 && Points < 70 )
             { 
                  cout<<"Not enough points"<<endl<<endl; cin.get(); 
             }
             else if ( strcmp ( enemych, "si")==0 && Points >= 80 )
             {
                      sw.agility = 40;
                      sw.energy = 100;
                      sw.health = 800;
                      sw.hitpoints = 80;
                      
                   Ehitpoints = sw.hitpoints;
                   Eagility = sw.agility;
                   Eenergy = sw.energy;
                   Ehealth = sw.health;
                   
                      game();
                      break;
             }
             else if ( strcmp ( enemych, "si")==0 && Points < 80 )
             { 
                  cout<<"Not enough points"<<endl<<endl; cin.get(); 
             }
             else
             {
                 cout<<"Letter not acceptable."<<endl;
             }
             }
           }
           else if (strcmp ( menu, "s")==0)
           {
             cout<<"Buy [P]oints-10PTS--500 money"<<endl;
             cout<<"Buy [E]nergy-20ERG--700 money"<<endl;
             cout<<"Buy [A]tack--20ATK--700 money"<<endl;
             cout<<"[L]eave Shop"<<endl;
             
             
             char b[1];
             cin>> b;
             
             if (strcmp ( b, "p")==0 && money >= 500 )
             {
                 money-= 500;
                 Points+= 10;
             ofstream y_file ( "points.dll", ios::trunc );
             y_file<<Points;
             y_file.close();
             ofstream q_file ( "money.dll", ios::trunc );
             q_file<<money;
             q_file.close();
             }
             else if (strcmp ( b, "p")==0 && money < 500 )
             {
                    cout<<"Not enough money. Sorry"<<endl;
             }
             
             else if (strcmp ( b, "e")==0 && money >= 700 )
             {
                 money-= 700;
                 energy+= 20;
             ofstream y_file ( "energy.dll", ios::trunc );
             y_file<<Points;
             y_file.close();
             ofstream q_file ( "money.dll", ios::trunc );
             q_file<<money;
             q_file.close();
             }
             else if (strcmp ( b, "e")==0 && money < 700 )
             {
                    cout<<"Not enough money. Sorry"<<endl;
             }
             
             else if (strcmp ( b, "a")==0 && money >= 700 )
             {
                 money-= 700;
                 hitpoints+= 10;
             ofstream y_file ( "hitpoints.dll", ios::trunc );
             y_file<<Points;
             y_file.close();
             ofstream q_file ( "money.dll", ios::trunc );
             q_file<<money;
             q_file.close();
             }
             else  if (strcmp ( b, "a")==0 && money < 700)
             {
                    cout<<"Not enough money. Sorry"<<endl;
             }
             else if (strcmp ( b, "e")==0)
             {}
           }
        else if (strcmp (menu, "i") ==0)
        {
             cout<<endl<<"You have "<<Points<<" points."<<endl;
             cout<<endl<<"You have "<<money<<" coins."<<endl;
             cout<<endl<<"You have "<<exp<<" experience."<<endl;
             cout<<endl<<"You have "<<hitpoints<<" Atack points."<<endl;
             cout<<endl<<"You have "<<energy<<" Energy."<<endl;
             cout<<endl<<"You are level "<<lvl<<"."<<endl;
        }
        else if (strcmp (menu, "e") ==0)
        {
             cout<<"Are u sure? (Y/N)"<<endl;
             
             char exit[1];
             cin>> exit;
             
             if ( strcmp ( exit, "y") ==0 )
             {
                  break;
             }
             else if ( strcmp ( exit, "n") == 0 )
             {
             
             }
        }
    }}
    
    
    int main(int argc, char *argv[])
    {
    
        
    
                  
        ifstream b_file ("points.dll");
        b_file>>Points;
        if ( !b_file.is_open() )
        {
             Points = 0;
        }
        else 
        {
        }
        
        ifstream m_file ("money.dll");
        m_file>>money;
        if (!m_file.is_open ())
        {
            money = 0;
        }
        else {}
        
        ifstream exp_file ("exp.dll");
        exp_file>>exp;
        if (!exp_file.is_open ())
        {
            exp = 0;
        }
        else {}
        ifstream l_file ("lvl.dll");
        l_file>>lvl;
        if (!l_file.is_open ())
        {
            lvl = 1;
        }
        else {}
        ifstream l3( "l2.bmp" );
        l3>>lvls;
        l3.close();
        
        
        cout<<"  W E A L C O M E   T O :"<<endl; 
        cout<<"Wyvern's Knight Challenge:"<<endl;
        
        for (int xyz = 0; xyz < 1; xyz++)
        {
            system ("color 1");
            system ("color 2");
            system ("color 3");
            system ("color 4");
            system ("color 5");
            system ("color 6");
            system ("color 7");
            system ("color 8");
            system ("color 9");
            system ("color 0");
            system ("color a");
            system ("color b");
            system ("color c");
            system ("color d");
            system ("color e");
            system ("color f");
        }
            system ("color 7");
        cout<<endl<<endl;
        system("pause");
        cout<<endl;
        
    
        cout<<"Use ALWAYS smal letters (right: a, b, c... wrong: A, B, C...)"<<endl<<endl;    
        while( 1 )
      {
    
        cout<<endl<<"[G]enerate character "<<endl;
        cout<<"[L]oad character "<<endl;
        cout<<"[C]reditzzzzzzzzzzzz "<<endl;
        cout<<"[Q]uit (bye, bye) "<<endl;
        
        char cin1[10];
        cin>> cin1;
        cin.ignore();
        
        if ( strcmp (cin1, "g") == 0)
        {
             while (1)
             {
             cout<<endl<<"Select your Character"<<endl<<endl;
             cout<<"[W]IZARD      [K]night"<<endl;
             cout<<"[E]lf         [T]hief"<<endl;
             cout<<" << [H]oly Wyvern >>"<<endl;
    
             
             
             
             cin>> cha;
             
             
        
             
             if ( strcmp ( cha, "w") ==0)
             {
               cout<<"Enter it's name: ";
               cin>>namew;
             
             wizard.agility = 5;
             wizard.energy = 30;
             wizard.health = 200;
             wizard.hitpoints = 10;
             wizard.cexp = 0;
             wizard.clvl = 1;
             wizard.cmoney = 0;
             wizard.cpoints = 0;
                      
                      health = wizard.health;
                      hitpoints = wizard.hitpoints;
                      energy = wizard.energy;
                      agility = wizard.agility;
                      exp = wizard.cexp;
                      money =wizard.cmoney;
                      lvl = wizard.clvl;
                      Points = wizard.cpoints;
    
                      
                      ofstream wiz ("wizard_name.dll" );
                      wiz<<namew;
                      wiz.close();
                      
                      ofstream wiz_h ( "wizard_health.dll");
                      wiz_h<<health;
                      wiz_h.close();
                      
                      ofstream wiz_a ( "wizard_hitpoints.dll");
                      wiz_a<<hitpoints;
                      wiz_a.close();
                      
                      ofstream wiz_e ( "wizard_energy.dll");
                      wiz_e<<energy;
                      wiz_e.close();
                      
                      ofstream wiz_ag ("wizard_agility.dll");
                      wiz_a<<hitpoints;
                      wiz_a.close();
                      
                      ofstream wiz_ex ("wizard_exp.dll");
                      wiz_ex<<exp;
                      wiz_ex.close();
                      
                      ofstream wiz_lvl ("wizard_lvl.dll");
                      wiz_lvl<<lvl;
                      wiz_lvl.close();
                      
                      ofstream wiz_po ("wizard_points.dll");
                      wiz_po<<Points;
                      wiz_po.close();
                      
                      ofstream wiz_mo ("wizard_money.dll");
                      wiz_mo<<money;
                      wiz_mo.close();
                      
                      break;
             }
             else if ( strcmp ( cha, "k") == 0)
             {
                  cout<<"Enter it's name:"<<endl;
                  cin>> namek;
                  
                  knight.agility = 10;
                  knight.energy = 5;
                  knight.health = 200;
                  knight.hitpoints = 30;
                  knight.cexp = 0;
                  knight.clvl = 1;
                  knight.cmoney = 0;
                  knight.cpoints = 0;
                      
                  health = knight.health;
                  hitpoints = knight.hitpoints;
                  energy = knight.energy;
                  agility = knight.agility;
                  exp = knight.cexp;
                  money =knight.cmoney;
                  lvl = knight.clvl;
                  Points = knight.cpoints;
    
                      
                  ofstream kng ("knight_name.dll" );
                  kng<<namek;
                  kng.close();
                      
                  ofstream kng_h ( "knight_health.dll");
                  kng_h<<health;
                  kng_h.close();
                      
                  ofstream kng_a ( "knight_hitpoints.dll");
                  kng_a<<hitpoints;
                  kng_a.close();
                      
                      ofstream kng_e ( "knight_energy.dll");
                      kng_e<<energy;
                      kng_e.close();
                      
                      ofstream kng_ag ("knight_agility.dll");
                      kng_a<<hitpoints;
                      kng_a.close();
                      
                      ofstream kng_ex ("knight_exp.dll");
                      kng_ex<<exp;
                      kng_ex.close();
                      
                      ofstream kng_lvl ("knight_lvl.dll");
                      kng_lvl<<lvl;
                      kng_lvl.close();
                      
                      ofstream kng_po ("knight_points.dll");
                      kng_po<<Points;
                      kng_po.close();
                      
                      ofstream kng_mo ("knight_money.dll");
                      kng_mo<<money;
                      kng_mo.close();
                      break;
             }
             else if ( strcmp ( cha, "e") == 0)
             {
                  cout<<"Enter it's name:"<<endl;
                  cin>> namee;
                  
                  elf.agility = 20;
                  elf.energy = 20;
                  elf.health = 200;
                  elf.hitpoints = 20;
    
                  elf.cexp = 0;
                  elf.clvl = 1;
                  elf.cmoney = 0;
                  elf.cpoints = 0;
                      
                  health = elf.health;
                  hitpoints = elf.hitpoints;
                  energy = elf.energy;
                  agility = elf.agility;
                  exp = elf.cexp;
                  money =elf.cmoney;
                  lvl = elf.clvl;
                  Points = elf.cpoints;
    
                      
                  ofstream elf ("elf_name.dll" );
                  elf<<namee;
                  elf.close();
                      
                  ofstream elf_h ( "elf_health.dll");
                  elf_h<<health;
                  elf_h.close();
                      
                  ofstream elf_a ( "elf_hitpoints.dll");
                  elf_a<<hitpoints;
                  elf_a.close();
                      
                      ofstream elf_e ( "elf_energy.dll");
                      elf_e<<energy;
                      elf_e.close();
                      
                      ofstream elf_ag ("elf_agility.dll");
                      elf_a<<hitpoints;
                      elf_a.close();
                      
                      ofstream elf_ex ("elf_exp.dll");
                      elf_ex<<exp;
                      elf_ex.close();
                      
                      ofstream elf_lvl ("elf_lvl.dll");
                      elf_lvl<<lvl;
                      elf_lvl.close();
                      
                      ofstream elf_po ("elf_points.dll");
                      elf_po<<Points;
                      elf_po.close();
                      
                      ofstream elf_mo ("elf_money.dll");
                      elf_mo<<money;
                      elf_mo.close();
                      break;
             }
             else if ( strcmp ( cha, "t") == 0)
             {               
                  cout<<"Enter it's name:"<<endl;
                  cin>> namet;
                  thief.agility = 20;
                  thief.energy = 5;
                  thief.health = 300;
                  thief.hitpoints= 15;
                  
                  thief.cexp = 0;
                  thief.clvl = 1;
                  thief.cmoney = 0;
                  thief.cpoints = 0;
                      
                  health = thief.health;
                  hitpoints = thief.hitpoints;
                  energy = thief.energy;
                  agility = thief.agility;
                  exp = thief.cexp;
                  money =thief.cmoney;
                  lvl = thief.clvl;
                  Points = thief.cpoints;
    
                      
                  ofstream thief ("thief_name.dll" );
                  thief<<namet;
                  thief.close();
                      
                  ofstream thief_h ( "thief_health.dll");
                  thief_h<<health;
                  thief_h.close();
                      
                  ofstream thief_a ( "thief_hitpoints.dll");
                  thief_a<<hitpoints;
                  thief_a.close();
                      
                      ofstream thief_e ( "thief_energy.dll");
                      thief_e<<energy;
                      thief_e.close();
                      
                      ofstream thief_ag ("thief_agility.dll");
                      thief_a<<hitpoints;
                      thief_a.close();
                      
                      ofstream thief_ex ("thief_exp.dll");
                      thief_ex<<exp;
                      thief_ex.close();
                      
                      ofstream thief_lvl ("thief_lvl.dll");
                      thief_lvl<<lvl;
                      thief_lvl.close();
                      
                      ofstream thief_po ("thief_points.dll");
                      thief_po<<Points;
                      thief_po.close();
                      
                      ofstream thief_mo ("thief_money.dll");
                      thief_mo<<money;
                      thief_mo.close();
                      break;
             }    
             else if ( strcmp ( cha, "h") == 0 && hw == 1)
             {               
                  cout<<"Enter it's name:"<<endl;
                  cin>> nameh;
                  holy.agility = 40;
                  holy.energy = 100;
                  holy.health = 600;
                  holy.hitpoints= 90;
                  
                  holy.cexp = 0;
                  holy.clvl = 1;
                  holy.cmoney = 0;
                  holy.cpoints = 0;
                      
                  health = holy.health;
                  hitpoints = holy.hitpoints;
                  energy = holy.energy;
                  agility = holy.agility;
                  exp = holy.cexp;
                  money =holy.cmoney;
                  lvl = holy.clvl;
                  Points = holy.cpoints;
    
                      
                  ofstream holy ("holy_name.dll" );
                  holy<<nameh;
                  holy.close();
                      
                  ofstream holy_h ( "holy_health.dll");
                  holy_h<<health;
                  holy_h.close();
                      
                  ofstream holy_a ( "holy_hitpoints.dll");
                  holy_a<<hitpoints;
                  holy_a.close();
                      
                      ofstream holy_e ( "holy_energy.dll");
                      holy_e<<energy;
                      holy_e.close();
                      
                      ofstream holy_ag ("holy_agility.dll");
                      holy_a<<hitpoints;
                      holy_a.close();
                      
                      ofstream holy_ex ("holy_exp.dll");
                      holy_ex<<exp;
                      holy_ex.close();
                      
                      ofstream holy_lvl ("holy_lvl.dll");
                      holy_lvl<<lvl;
                      holy_lvl.close();
                      
                      ofstream holy_po ("holy_points.dll");
                      holy_po<<Points;
                      holy_po.close();
                      
                      ofstream holy_mo ("holy_money.dll");
                      holy_mo<<money;
                      holy_mo.close();
                      break;
             }
             else if ( strcmp ( cha, "h") == 0 && hw == 0) 
             {
                  cout<<"U must have any character at level 20 before using Holy Wyvern"<<endl;
                  cin.get();
             }
        }}
        
        else if (strcmp (cin1, "l") ==0)
        {
             cout<<endl<<"Which u want to load?"<<endl;
             ifstream w1 ( "wizard_name.dll" );
             w1>>namew;
             w1.close();
             ifstream k1 ( "knight_name.dll" );
             k1>>namek;
             k1.close();
             ifstream e1 ( "elf_name.dll" );
             e1>>namee;
             e1.close();
             ifstream t1 ( "thief_name.dll" );
             t1>>namet;
             t1.close();
             ifstream h1 ( "holy_name.dll" );
             h1>>nameh;
             h1.close();
             
             
             cout<<endl<<"(Remember that if u didn't made a character and u load it game may crash)"<<endl<<endl;
    
             cout<<namew<<" -- press w"<<endl;
             cout<<namek<<" -- press k"<<endl;
             cout<<namee<<" -- press e"<<endl;
             cout<<namet<<" -- press t"<<endl;
             cout<<nameh<<" -- press h"<<endl;
    
             
             cin>>load;
             
             if (strcmp (load,"k") ==0)
             {
                        ifstream k2 ( "knight_health.dll" );
                        k2>>health;
                        k2.close();
                      
                        ifstream k3 ( "knight_hitpoints.dll");
                        k3>>hitpoints;
                        k3.close();
                      
                        ifstream k4 ( "knight_energy.dll");
                        k4>>energy;
                        k4.close();
                      
                        ifstream k5 ( "knight_agility.dll");
                        k5>>hitpoints;
                        k5.close();
                        
                        ifstream k6 ( "knight_exp.dll");
                        k6>>exp;
                        k6.close();
                        
                        ifstream k7 ( "knight_lvl.dll");
                        k7>>lvl;
                        k7.close();
                        
                        ifstream k8 ( "knight_points.dll");
                        k8>>Points;
                        k8.close();
                        
                        ifstream k9 ( "knight_money.dll");
                        k9>>money;
                        k9.close();        
             }
             else if (strcmp (load,"w") ==0)
             {
                  ifstream w2 ( "wizard_health.dll" );
                        w2>>health;
                        w2.close();
                      
                        ifstream w3 ( "wizard_hitpoints.dll");
                        w3>>hitpoints;
                        w3.close();
                      
                        ifstream w4 ( "wizard_energy.dll");
                        w4>>energy;
                        w4.close();
                      
                        ifstream w5 ( "wizard_agility.dll");
                        w5>>hitpoints;
                        w5.close();
                        
                        ifstream w6 ( "wizard_exp.dll");
                        w6>>exp;
                        w6.close();
                        
                        ifstream w7 ( "wizard_lvl.dll");
                        w7>>lvl;
                        w7.close();
                        
                        ifstream w8 ( "wizard_points.dll");
                        w8>>Points;
                        w8.close();
                        
                        ifstream w9 ( "wizard_money.dll");
                        w9>>money;
                        w9.close();
             }
             else if (strcmp (load,"e") ==0)
             {
                        ifstream e2 ( "elf_health.dll" );
                        e2>>health;
                        e2.close();
                      
                        ifstream e3 ( "elf_hitpoints.dll");
                        e3>>hitpoints;
                        e3.close();
                      
                        ifstream e4 ( "elf_energy.dll");
                        e4>>energy;
                        e4.close();
                      
                        ifstream e5 ( "elf_agility.dll");
                        e5>>hitpoints;
                        e5.close();
                        
                        ifstream e6 ( "elf_exp.dll");
                        e6>>exp;
                        e6.close();
                        
                        ifstream e7 ( "elf_lvl.dll");
                        e7>>lvl;
                        e7.close();
                        
                        ifstream e8 ( "elf_points.dll");
                        e8>>Points;
                        e8.close();
                        
                        ifstream e9 ( "elf_money.dll");
                        e9>>money;
                        e9.close();
             }
             else if (strcmp (load,"t") ==0)
             {
                  ifstream t2 ( "thief_health.dll" );
                        t2>>health;
                        t2.close();
                      
                        ifstream t3 ( "thief_hitpoints.dll");
                        t3>>hitpoints;
                        t3.close();
                      
                        ifstream t4 ( "thief_energy.dll");
                        t4>>energy;
                        t4.close();
                      
                        ifstream t5 ( "thief_agility.dll");
                        t5>>hitpoints;
                        t5.close();
                        
                        ifstream t6 ( "thief_exp.dll");
                        t6>>exp;
                        t6.close();
                        
                        ifstream t7 ( "thief_lvl.dll");
                        t7>>lvl;
                        t7.close();
                        
                        ifstream t8 ( "thief_points.dll");
                        t8>>Points;
                        t8.close();
                        
                        ifstream t9 ( "thief_money.dll");
                        t9>>money;
                        t9.close();
             }
             else if (strcmp (load,"h") ==0)
             {
                  system("color 0F");
                        ifstream h2 ( "holy_health.dll" );
                        h2>>health;
                        h2.close();
                      
                        ifstream h3 ( "holy_hitpoints.dll");
                        h3>>hitpoints;
                        h3.close();
                      
                        ifstream h4 ( "holy_energy.dll");
                        h4>>energy;
                        h4.close();
                      
                        ifstream h5 ( "holy_agility.dll");
                        h5>>hitpoints;
                        h5.close();
                        
                        ifstream h6 ( "holy_exp.dll");
                        h6>>exp;
                        h6.close();
                        
                        ifstream h7 ( "holy_lvl.dll");
                        h7>>lvl;
                        h7.close();
                        
                        ifstream h8 ( "holy_points.dll");
                        h8>>Points;
                        h8.close();
                        
                        ifstream h9 ( "holy_money.dll");
                        h9>>money;
                        h9.close();
             }
             menu();
         }
        else if (strcmp (cin1, "c") ==0)
        {
             cout<<"CREDITZ:\n PROGRAMMING: Wyvern"<<endl;
             cin.get();
        }
        else if ( strcmp ( cin1, "iwantholywyvern") == 0 )
        { hw = 1;}
        else if ( strcmp ( cin1, "q") == 0 )
        {
             cout<<"Are u sure? (Y/N)"<<endl;
             
             char cin2[1];
             cin>> cin2;
             
             if ( strcmp ( cin2, "y") ==0 )
             {
                  return 0;
             }
             else if ( strcmp ( cin2, "n") == 0 )
             {
             
             }
        }
     }
    
        
        cin.get();
        return EXIT_SUCCESS;
    }
    please i want feedbak

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Don't make all your functions inline, especially functions that are longer than 25 lines. Just remove the inline keyword and it should still work.

    Code:
    ifstream t3 ( "thief_hitpoints.dll");
                        t3>>hitpoints;
                        t3.close();
                      
                        ifstream t4 ( "thief_energy.dll");
                        t4>>energy;
                        t4.close();
                      
                        ifstream t5 ( "thief_agility.dll");
                        t5>>hitpoints;
                        t5.close();
                        
                        ifstream t6 ( "thief_exp.dll");
                        t6>>exp;
                        t6.close();
                        
                        ifstream t7 ( "thief_lvl.dll");
                        t7>>lvl;
                        t7.close();
                        
                        ifstream t8 ( "thief_points.dll");
                        t8>>Points;
                        t8.close();
                        
                        ifstream t9 ( "thief_money.dll");
                        t9>>money;
                        t9.close();
    You can write more than one thing to a file at once!

    Code:
    else if (exp >500 && exp <= 1400 && lvls ==1 )
             {
                   lvl = 2;
                   hitpoints += 10;
                   energy += 10;
                   lvls = 2 ;
             }
             else if (exp >1400 && exp <= 2600 && lvls ==2)
             {
                          lvl = 3;
                          hitpoints += 20;
                          energy += 20;
                          lvls = 3;
             }
             else if (exp >2600 && exp <= 3100 && lvls ==3)
             {
                          lvl = 4;
                          hitpoints += 30;
                          energy += 30;
                          lvls++;
             }
             //...
    Check for the highest value first, as in this:
    Code:
    if(x > 2600) {}
    else if(x > 1400) {}
    else if(x > 500) {}
    Then you only need to compare with one variable.

    How long is that program?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    You should look into arrays to hold some of your data.

    Again, code like this
    Code:
    ofstream a_file ( "wizard_points.dll", ios::trunc );
             a_file<<Points;
             a_file.close();
             ofstream o_file ( "wizard_money.dll", ios::trunc );
             o_file<<money;
             o_file.close();
             ofstream ov_file ( "wizard_lvl.dll", ios::trunc );
             ov_file<<lvl;
             ov_file.close();
             ofstream ex_file ( "wizard_exp.dll", ios::trunc );
             ex_file<<exp;
             ex_file.close();
    Could be more like this:
    Code:
    ofstream a_file ( "wizard_points.dll", ios::trunc );
    a_file << var1 << endl << var2 << endl;
    a_file << var3 << endl << var3 << endl;
    You should choose more descriptive variable names if you can.

    As for local variables . . . Here's how you pass data between functions:
    Code:
    void print(int num, int num2) {
        cout << num << " and " << num2 << endl;
    }
    
    void call() {
        int x;
        print(44, 66);
        cin >> x;
        print(x, 3);
    }
    With that method, however, print() can't modify the variables (well, it can, but call() won't notice the changes). If you want the values to change:
    Code:
    #include <iostream>
    
    void plusone(int &var) {
        var ++;
    }
    
    int main() {
        int i = 2;
        plusone(i);
        cout << i;
        return 0;
    }
    That program will output
    Code:
    3
    You should keep reading your C++ book[s].
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Dragoon Lover wyvern's Avatar
    Join Date
    Jul 2005
    Location
    dragooncity
    Posts
    28

    Ty

    thankx u for the info really thank you and ... i dont read c++ books yet.

    for now my guide are the toturials in here

  5. #5
    Dragoon Lover wyvern's Avatar
    Join Date
    Jul 2005
    Location
    dragooncity
    Posts
    28
    i still dont understand this here:


    ""With that method, however, print() can't modify the variables (well, it can, but call() won't notice the changes). If you want the values to change:

    Code:
    Code:
    #include <iostream>
    
    void plusone(int &var) {
        var ++;
    }
    
    int main() {
        int i = 2;
        plusone(i);
        cout << i;
        return 0;
    }
    "" by: dwks.

    and another thing if u can find time to explain me :

    when o have a program and u need to input a letter of number ( show as cin>>var; on code) how i make it ignore typing enter to enter the var cuz usually u have to type for ex: A and click enter how i ignore Enter??????

    this is cunfussyyyyy ( made up this word now) but understand im not english im portuguese

  6. #6
    Advanced Novice linucksrox's Avatar
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    198
    Quote Originally Posted by wyvern
    i still dont understand this here:


    ""With that method, however, print() can't modify the variables (well, it can, but call() won't notice the changes). If you want the values to change:

    Code: ...
    "" by: dwks.
    Well first of all, dwks was saying that the print() function couldn't modify the variables. that's because they're passed by value instead of reference. so what that means is that when you call print(), the two numbers you pass to it are COPIED to print(), and when you change them in print, you're really only changing the COPY of them. so when the print() function finishes, you come back to main(), and the original values you passed it are still the same. the solution to that is to pass those values by reference. the difference is that you actually pass the REFERENCE TO the variable to the print() function. so now when you call print(), instead of copying the value and print() having its own copy, print() actually gets to read/modify the original value(s). if that makes sense. so if you change that value inside of print(), you actually change the original value, so when print() finishes executing, any changes you made in print() remain.
    so if you have the code:
    Code:
    #include <iostream>
    using namespace std;
    
    void changeNum(int num)
    {
        num = num + 72;
    }
    
    int main()
    {
        int originalNum = 0;
        cout << originalNum << endl;
        changeNum(int originalNum);
        cout << originalNum << endl;
        return 0;
    }
    that program prints out originalNum 2 times. the first time, it should print out 0. the second time is after you call that changeNum() function. but it still prints out 0. that's because when you're in changeNum() you only have a copy of originalNum, so originalNum never gets changed.

    but the new code:
    Code:
    #include <iostream>
    using namespace std;
    
    changeNum(int &num)
    {
        num = num + 72;
    }
    
    int main()
    {
        int originalNum = 0;
        cout << originalNum << endl;
        changeNum(int originalNum);
        cout << originalNum << endl;
        return 0;
    }
    that actually changes originalNum. there's no copy when you call changeNum(), so the variable "num" that you're using inside changeNum() is actually a reference to originalNum instead of just a copy of it. so when you change num, originalNum also changes. and all that's done by just adding that little "&" in front of num when you declare/define changeNum(). (anyone, feel free to correct me if i'm wrong about something)

    on to your next question:
    and another thing if u can find time to explain me :

    when o have a program and u need to input a letter of number ( show as cin>>var; on code) how i make it ignore typing enter to enter the var cuz usually u have to type for ex: A and click enter how i ignore Enter??????
    i'm really not sure exactly what you're asking, but it kinda sounds like you're asking about having the program automatically respond after you enter the character or number, instead of typing it and then having to hit enter. right? i really don't know how to do that in c++ yet, but i know how in C, though the way i do it is apparently specific to Windows. it has to do with keyboard buffering, and so you would have to use a function that uses unbuffered keyboard input. that means you can't use the "cin >> var". it'd be more of something like "getkey(var)" even though i don't think that's exactly the right command. look into unbuffered keyboard input functions to find out more about that.
    OR if what you were asking is how to ignore the rest of your input if you're just trying to have the user enter a character and then press enter, like let's say you want to enter a number 1 through 4, and the user enters something stupid like 47634k, but you don't want the program to read the part after the 4 (the "7634k" part), all you do is this:
    Code:
    cin >> var;
    cin.ignore(100, '\n');
    so the cin.ignore(100, '\n') part just tells the computer to skip all the input from where the cursor already is (and with the input above, the cursor will be set on that 7), for the next 100 characters, or the next return, whichever comes first. so usually it just means skip all the rest of the input on the current line.

    i hope all that helps you understand better... good luck!
    "What are all you parallelograms doing here?" - Peter Griffin (to Joe and his wheelchair buddies)

  7. #7
    Dragoon Lover wyvern's Avatar
    Join Date
    Jul 2005
    Location
    dragooncity
    Posts
    28

    Ty

    tankx u.

    ur 1st example was what i was asking but the second will certainly help me too.

    again TTTTTTTYYYYYYYY a lot.

  8. #8
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    You really should get a C++ book, though. It really helps.

    Thanks, linucksrox, for the explanation. Much longer than what I'd bother to type out.

    So let's see the most recent version of this program now.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  9. #9
    Advanced Novice linucksrox's Avatar
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    198
    yea i have wordy explanations... you know, i like to try to explain things in detail and make sure people understand what i'm trying to say. i hate when peop...... just kidding. anyway
    yea a book really helps with c++. tutorials are good, but i think books are better, at least in my opinion
    yea lets see the new code
    "What are all you parallelograms doing here?" - Peter Griffin (to Joe and his wheelchair buddies)

  10. #10
    Registered User
    Join Date
    Aug 2005
    Posts
    91
    That code up there looks far longer than anything I'd hope to make with 2 weeks C++ knowledge... wow.

  11. #11
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Code:
    if ( strcmp ( cha, "w") ==0)
    You might want to look at strpbrk():
    Code:
    if(strpbrk(cha, "wW") != 0)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  12. #12
    Pokemon Master digdug4life's Avatar
    Join Date
    Jan 2005
    Location
    Mystic Island, NJ
    Posts
    91
    It seems pretty good, but there wasnt really a need to post every line

  13. #13
    Registered User
    Join Date
    Sep 2005
    Location
    USA
    Posts
    69
    If you are going to build a game that big, you should spell all of your words right, like change
    cout<<"U must have any character at level 20 before using Holy Wyvern"<<endl;
    to
    Code:
    cout<<"You must have any character at level 20 before using Holy Wyvern"<<endl;
    Just a suggestion,
    Adam

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do the game engine and the api interact?
    By Shadow12345 in forum Game Programming
    Replies: 9
    Last Post: 12-07-2010, 11:08 PM
  2. Open Source / Semi Open source game idea. Help needed
    By CaptainPatent in forum Projects and Job Recruitment
    Replies: 10
    Last Post: 05-16-2007, 10:44 AM
  3. game engine advice?
    By stien in forum Game Programming
    Replies: 0
    Last Post: 01-23-2007, 02:46 PM
  4. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21