Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Project 3

Here are some projects of actual programs you can practice making.

Re: Project 3

Postby noobgrammer on Mon Oct 05, 2009 6:22 pm

I tried to compile it and had errors it looks like in monster.cpp you where going to add another case and left it half finished
I commented that out and it worked fine

So about the game I have to say its cool to see peoples creative side trying to make there games unique I enjoyed it. I'll admit I only played for a minute but I did notice one little thing was when I went to inventory with nothing it still made me equip nothing no way to back out which really wasn't a biggy. Just an observation.

Otherwise it was a fun little game good work keep the creativity going
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Project 3

Postby Streamfarm on Tue Oct 06, 2009 3:39 pm

Thanks for pointing that out, I fixed both bugs. It seems that I tried to add a new monster but then couldn't be bothered.
I'm uploading the fixed version to my original post.
Streamfarm
 
Posts: 2
Joined: Mon Oct 05, 2009 5:39 am

Re: Project 3

Postby Fatrabit on Sat Oct 17, 2009 7:55 pm

Here is my progress I know it's messy so please give me feedback.
I really want to add more heals as in a heal for 10 health and a heal for 20 health etcetera and cout health/cash before you choose the heal but I havn't wanted to put in the time to remake heal yet.
I think I could improve the combat system alot. Also I could simplify the character class but I havn't gotten to it yet.

warning: the game is not very well balanced yet again its far from done I just want to know how I'm doing so far especialy the style and organization.

http://rapidshare.com/files/294413840/C ... r.zip.html
Fatrabit
 
Posts: 11
Joined: Sun Sep 20, 2009 10:04 pm

Re: Project 3

Postby noobgrammer on Sun Oct 18, 2009 9:25 am

I mention this last night and I will show you what I meant. What you have is not wrong but is limited to option if later you decide to grow and add different characters

Code: Select all
character player(name,40,40,1,0,100,0,50);

Code: Select all
character::character(std::string charname,int _health, int _maxhealth, int _level, int _xp, int _cash, int _killcount, int _maxxp):   
   name(charname),
   health(_health),
   maxhealth(_maxhealth),
   level(_level),
   xp(_xp),
   cash(_cash),
   killcount(_killcount),
   maxxp(_maxxp)
{
}


now this part confuses me
Code: Select all
character fight(character player, bool &pdeath)

I forgot to save a copy so I think this was what you did. It confuses me because you are creating a whole new object (I think I could be wrong)
I just did this

Code: Select all
void fight(character &player, bool &pdeath)

notice I added & to the object I did that in the menu function also. I had to do a little editing after that I think mainly deleting player where you tried to return or assign fight to it.
I am no expert so I really can't give you design ideas or what not just a little help where I can. One suggestion I can give is don't use this
Code: Select all
using namespace std;

this is just one of the may things that antiRTFM meant about bad habits for programming using stuff without really knowing why. Its better to break this one while still learning. you can either just put a std:: before each place its needed but if you plan on a lot of couts and cins you can do this inside that function try not to do it globaly
Code: Select all
using std::cout;
using std::cin;


std:: is used on more than just that there are a lot more of them you will just have to figure out what they are as you go
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Project 3

Postby Fatrabit on Sun Oct 18, 2009 10:30 am

The fight() and constructer points make alot of sense. About std:: I started using namespace std; and then when I was already working through stuff I realised I should be using std:: I just didn't want to go back and change everything I had done. I'll stop bein lazy and fix it up. Thanks again noobgrammer!
Fatrabit
 
Posts: 11
Joined: Sun Sep 20, 2009 10:04 pm

Re: Project 3

Postby wabe on Tue Oct 20, 2009 6:16 pm

This is what I have managed to code so far. Code is messy because I could not separate it in functions... I guess I need pointers or something if I want to do that?
It does not cover all the requirements yet, but I hope I can add exp, items, gold etc. later.
I am actually pretty suprised I was able to make it this far. :D
When I first time saw this topic I had no idea how should I start such a huge program. Anyway, feel free to tell me if the code is awful and how I could improve it.
Thanks!

Code: Select all
#include "stdafx.h"
#include <ctime>
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;


class player
{
public:
      void start()
   {
      health = 100;
      blockper = 0;
      damage = 0;
   }
   
   
   
   void start2(int x, int y)
   {
      health = 100;
      blockper = x;
      damage = y;
   }

   bool block()
   {
      
      if ((rand() % 100) < blockper) {return true;}
      else
      {return false;}
   }

   int attack()
   {
      if (damage > 17)
      {
         return (rand() % 20) + damage;
      }
      else
      {
         return (rand() % 10) + damage;
      }
   }

   void gethit ( int hp )
   {
      health -= hp;
   }

      int gethp()
   {
      return health;
   }

private:
   int health;
   int blockper;
   int damage;
};


int main()
{
   /*srand(time(0));*/
   bool fight = true;

   int choose = 0;
   cout << "Welcome to fight!" << endl;
   player hero, ogre;
   hero.start();
   while (!(choose == 1 || choose == 2))
   {
      cout << "Please choose your speciality:" << endl;
      cout << "\nSpeciality:            Effect:" << endl;
      cout << "1:Shield Mastery   -   Higher chance to block." << endl;
      cout << "2:Sword Mastery    -   Higher chance to deal more damage." << endl;
      cout << "\nYour choice: ";
      cin >> choose;
      
         switch (choose)
         {
            case 1:
               cout << "You have chosen Shield Mastery. You have 30% higher chance to block an enemy attack compared to Sword Mastery, but your max damage is limited to 25." << endl;
               hero.start2(50, 15);
               break;
            case 2:
               cout << "You have chosen Sword Mastery. You have chance to deal damage up to 40, but your chance to block is 30% lower." << endl;
               hero.start2(20, 20);
               break;
            
            default:
               cout << "Without proper speciality you are not allowed to fight. Choose again." << endl;
               system("pause");
               system("cls");
         }
      
   }
   int ogre_type; 
   ogre_type = 1;
   if (ogre_type == 1)
   {
      ogre.start2(50,10);
      cout << "\nYour opponent's choice was: Shield Mastery!" << endl;
   }
   else
   {
      ogre.start2(20,20);
      cout << "\nYour opponent's choice was: Sword Mastery!" << endl;
   }

   cout << "\n";
   system("pause");
   system("CLS");
   
   
   
      
while (fight = true)
   {
      cout << "\nPlayer's turn" << endl;
      cout << "Player attacks and..." << endl;

         if (ogre.block() == true) cout << "Ogre blocked your attack!" << endl;
         else
         {
            int dmg = hero.attack();
            if (dmg >= 39) {cout << "\n!Super Lucky Attack!\n";}
            cout << "...deals " << dmg << " Dmg!\n";
            ogre.gethit( dmg );
            cout << "Ogre has " << ogre.gethp() << " health points left." << endl;
         }
      
      Sleep(3000);
            if (ogre.gethp() <= 0)
            {
               cout << "you have defeated the ogre! You win! Congratulations!" << endl;
               //victory();
               fight = false;
               break;
            }
            else if (hero.gethp() <= 0)
            {
               cout << "You have been slain by the ogre. You lose!" << endl;
               fight = false;
               break;
            }
            else
            {
            
                  cout << "\nOgre's turn" << endl;
                  cout << "Ogre attacks and..." << endl;

                  if (hero.block() == true) cout << "You blocked ogre's attack!" << endl;
                  else
                  {
                     int dmg = ogre.attack();
                     if (dmg >= 39) {cout << "\n!Super Lucky Attack!\n";}
                     cout << "...deals " << dmg << " Dmg!\n";
                     hero.gethit( dmg );
                     cout << "You have " << hero.gethp() << " health points left." << endl;
                  }
            }
      
      
      
      Sleep(3000);
                              
            if (ogre.gethp() <= 0)
            {
               cout << "you have defeated the 'ogre! You win! Congratulations!" << endl;
               //victory();
               fight = false;
               break;
            }
            else if (hero.gethp() <= 0)
            {
               cout << "You have been slain by the ogre. You lose!" << endl;
               fight = false;
               break;
            }
            else
            {
               fight = true;
            }
   }
   
   cout << endl;
   system("pause");
}
User avatar
wabe
 
Posts: 6
Joined: Sat Oct 17, 2009 2:35 pm
Location: Finland

Re: Project 3

Postby noobgrammer on Wed Oct 21, 2009 9:04 am

here you go wabe I redid it using the class more in the way it should be used and commented in the code the help explain what/why I did it

Player.h
Code: Select all
#ifndef PLAYER_H//not necessary here but good habit to just do
#define PLAYER_H

#include <iostream>

class Player
{
    public:
       
      Player(){}//default constructor
      Player(int , int , int );
      ~Player(){}//destructor//don't need but good habit anyway

//you do not need these two functions that is what the constructors are for
//the second you create a object the constructor is automaticly called
      
      /*   
      void start()
       {
          health = 100;
          blockper = 0;
          damage = 0;
       }
       */
       
       /*
       void start2(int x, int y)
       {
          health = 100;
          blockper = x;
          damage = y;
       }
      */
       bool block();
       
       int attack();
       int gethp();

       void gethit (int hp);
       
private:
       int health;
       int blockper;
       int damage;
};

#endif


Player.cpp
Code: Select all
#include "player.h"//use quotes not <> when calling your own made headers

Player::Player(int _health, int _blockper, int _damage) :
   health(_health),
    blockper(_blockper),
    damage(_damage)
   {}//if you have other stuff you want done when createing your object

//you need to use Player:: before the member function to tell where they belong
bool Player::block()
{
   
   if ((rand() % 100) < blockper)
   {
      return true;
   }
    else
    {
      return false;
   }
}

int Player::attack()
{
     if (damage > 17)
     {
      return (rand() % 20) + damage;
     }
     else
     {
        return (rand() % 10) + damage;
     }
}

int Player::gethp()
{
    return health;
}

void Player::gethit(int hp)
{
     health -= hp;
}


main.cpp
Code: Select all
#include <ctime>
//#include <cstdlib>//this not a necesary header
//#include <iostream>//this is called inside your player header and pass through when you include the player header here
#include <windows.h>
#include "player.h"
   
//using namespace std;//bad practice

int main()
{
    using std::cout;//if you plan on having a lot of them then use this inside of scope not global
    //using std::cin;//since you have one I just commented it out and did it the other way, the better way I believe
    using std::endl;
      /*srand(time(0));*///not sure why you commented this out putting the unsigned in there will get rid of the warrning
    srand((unsigned)time(0));
       bool fight = true;

       int choose = 0;
       cout << "Welcome to fight!" << endl;
       //player hero, ogre;//This was fine I just like to give them there own lines and use a capital to help define it was a class object
      Player Hero;//creates your object//calls default constructor
      Player Ogre;//creates your object//calls default constructor
       //hero.start();//constructors do this job for you
       while (!(choose == 1 || choose == 2))
       {
          cout << "Please choose your speciality:" << endl;
          cout << "\nSpeciality:            Effect:" << endl;
          cout << "1:Shield Mastery   -   Higher chance to block." << endl;
          cout << "2:Sword Mastery    -   Higher chance to deal more damage." << endl;
          cout << "\nYour choice: ";
        std::cin >> choose;//this is the best way to do it helps before you create a bad habit, the std::
         
             switch (choose)
             {
          case 1:
                   cout << "You have chosen Shield Mastery. You have 30% higher chance to block an enemy attack compared to Sword Mastery, but your max damage is limited to 25." << endl;
                   //hero.start2(50, 15);
               Hero = Player(100, 50, 15);//calls constructor with parameters
               break;
         
          case 2:
         
                   cout << "You have chosen Sword Mastery. You have chance to deal damage up to 40, but your chance to block is 30% lower." << endl;
                   //hero.start2(20, 20);//this is what constructors are for
               Hero = Player(100, 20, 20);//calls constructor with parameters
               break;
         
               
          default:
         
                   cout << "Without proper speciality you are not allowed to fight. Choose again." << endl;
                   system("pause");
                   system("cls");
             }
         
       }
       int ogre_type = 1;
       //ogre_type = 1;// nothing wrong here just did that way instead, user preference
       if (ogre_type == 1)
       {
          //ogre.start2(50,10);//this is what constructors are for
         Ogre = Player(100, 50, 10);//calls constructor with parameters
          cout << "\nYour opponent's choice was: Shield Mastery!" << endl;
       }
       else
       {
          //ogre.start2(20,20);//this is what constructors are for
         Ogre = Player(100, 20, 20);//calls constructor with parameters
          cout << "\nYour opponent's choice was: Sword Mastery!" << endl;
       }

       cout << "\n";
       system("pause");
       system("CLS");
       
       
       
         
    while (fight = true)
       {
          cout << "\nPlayer's turn" << endl;
          cout << "Player attacks and..." << endl;

             if (Ogre.block() == true) cout << "Ogre blocked your attack!" << endl;
             else
             {
                int dmg = Hero.attack();
                if (dmg >= 39) {cout << "\n!Super Lucky Attack!\n";}
                cout << "...deals " << dmg << " Dmg!\n";
                Ogre.gethit( dmg );
                cout << "Ogre has " << Ogre.gethp() << " health points left." << endl;
             }
         
          Sleep(3000);
                if (Ogre.gethp() <= 0)
                {
                   cout << "you have defeated the ogre! You win! Congratulations!" << endl;
                   //victory();
                   fight = false;
                   break;
                }
                else if (Hero.gethp() <= 0)
                {
                   cout << "You have been slain by the ogre. You lose!" << endl;
                   fight = false;
                   break;
                }
                else
                {
               
                      cout << "\nOgre's turn" << endl;
                      cout << "Ogre attacks and..." << endl;

                      if (Hero.block() == true) cout << "You blocked ogre's attack!" << endl;
                      else
                      {
                         int dmg = Ogre.attack();
                         if (dmg >= 39) {cout << "\n!Super Lucky Attack!\n";}
                         cout << "...deals " << dmg << " Dmg!\n";
                         Hero.gethit( dmg );
                         cout << "You have " << Hero.gethp() << " health points left." << endl;
                      }
                }
         
         
         
          Sleep(3000);
                                 
                if (Ogre.gethp() <= 0)
                {
                   cout << "you have defeated the 'ogre! You win! Congratulations!" << endl;
                   //victory();
                   fight = false;
                   break;
                }
                else if (Hero.gethp() <= 0)
                {
                   cout << "You have been slain by the ogre. You lose!" << endl;
                   fight = false;
                   break;
                }
                else
                {
                   fight = true;
                }
       }
       
       cout << endl;
       system("pause");
    }


hope this helps you
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Project 3

Postby wabe on Wed Oct 21, 2009 3:00 pm

Thank you noobgrammar! That certainly sort things out. It sure is good idea to separate class in to in different files.
With constructor I got some problems so I simply decided to use start() function.

Is there way to put this in a function? Am I supposed to use pointers for those variables if I want to get this work as a function?
It would clean the code much if I could just check with a function if the battle is over or not.
Code: Select all
if (Ogre.gethp() <= 0)
                {
                   cout << "you have defeated the 'ogre! You win! Congratulations!" << endl;
                   //victory();
                   fight = false;
                   break;
                }
                else if (Hero.gethp() <= 0)
                {
                   cout << "You have been slain by the ogre. You lose!" << endl;
                   fight = false;
                   break;
                }
                else
                {
                   fight = true;
                }
User avatar
wabe
 
Posts: 6
Joined: Sat Oct 17, 2009 2:35 pm
Location: Finland

Re: Project 3

Postby noobgrammer on Wed Oct 21, 2009 3:49 pm

I prefer reference to pointer when I can

just make a function and put the class in it like this

this is my function declaration at the top
Code: Select all
bool defeatCheck(Player &, Player &);


then I replaced the code with this

Code: Select all
fight = defeatCheck(Ogre,Hero);


and here is the accual function at the bottom.

Code: Select all
bool defeatCheck(Player &ogre, Player &hero)
      {
         if (ogre.gethp() <= 0)
                    {
                  std::cout << "you have defeated the 'ogre! You win! Congratulations!" << std::endl;
                       //victory();
                       return false;
                       //break;
                    }
                    else if (hero.gethp() <= 0)
                    {
                  std::cout << "You have been slain by the ogre. You lose!" << std::endl;
                       return false;
                       //break;
                    }
                    else
                    {
                       return true;
                    }
      }


you will see that since it is out of mains scope I had to add the std:: to the cout and endl.

the problem you had with having to make your start function was is you where probably trying to make your class object inside of a switch and the problem with that is scope. You would have made and destroyed right there on the spot since between the braces {} is the scope length of and object and you where inside of the switches scope. So the compiler new nothing of all the calls to a class that doesn't exist since the object got destroyed.
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Project 3

Postby wabe on Fri Oct 23, 2009 9:13 am

I see. I think I need to finish videos before trying this method. Thanks for the tips!
User avatar
wabe
 
Posts: 6
Joined: Sat Oct 17, 2009 2:35 pm
Location: Finland

Re: Project 3

Postby noobgrammer on Fri Oct 23, 2009 10:22 am

I don't recall him talking about passing class objects through a function but it isn't a difficult idea really. You just need to think of your class like its a data type
char, int double are data types and when you pass a variable through a function you have to tell it what data type your passing. Same thing with a class when you pass a object through a function you have to tell the function what data type so

Code: Select all
bool defeatCheck(Player &ogre, Player &hero)


Player would be the data type and ogre would be what you are passing through. The & makes sure that you are dealing with the actual object being passed in and not a copy of it. Just like anything else being passed through a function using a pointer or a reference lets you work with actual data not copys of them
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Project 3

Postby iceman on Fri Nov 20, 2009 6:02 am

I will be making this one next, i am going down the list, did the calculator one, now to try this one. :)
WISH ME LUCK! ;)
iceman
 
Posts: 6
Joined: Fri Nov 20, 2009 3:58 am

Re: Project 3

Postby `Sp3ke on Sun Dec 06, 2009 6:17 am

Start of mine (Not finished yet) : -

main.cpp

Code: Select all
/*
--------------------------------
Text-Based RPG - Made by Sp3ke 
--------------------------------
*/

#include "stdafx.h"
#include "player.h"
#include <iostream>
#include <string>
#include <ctime>
#include <windows.h>
using namespace std;

int main()
{
   player HumanPlayer;
   srand((long)time(0)); //Generates a new number each time program restarts
   char Continue; //Continue playing
   int MenuSelection;
   string PlayersName;
   
   cout<<"Welcome to Beavers Text-Based RPG\n";
   cout<<"To begin your adventure type your name : "<<endl<<endl;
   cin>>PlayersName; //Player inputs there name

   cout<<endl<<"Welcome "<<PlayersName<< " your adventure starts right here!\n"<<endl<<endl<<endl<<endl;
   Sleep(2000);

   do{ //Start of Menu - loop
      cout<<"-----------------"<<endl;
      cout<<"  Main Menu (1-4) "<<endl;
      cout<<"-----------------"<<endl;
      cout<<"1) - View Stats -\n";
      cout<<"2) - Combat Arena -\n";
      cout<<"3) - Medical Centre -\n";
      cout<<"4) - Quit Program -\n";
      cin>>MenuSelection;

      switch(MenuSelection)
      { //Start of MenuSelection
      case 1:
         HumanPlayer.CheckStats();
         break;
      case 2:
         cout<<endl<<endl<<"Combat Arena\n";
         cout<<"--------------"<<endl;
         cout<<"Select the NPC you wish to attack : "<<endl;
         cout<<"1) - Goblin -\n";
         cout<<"2) - Orge - \n";
         cout<<"3) - Troll - \n";
         cout<<"4) - Demon - \n";
         cin>>MenuSelection;
         switch(MenuSelection) //NPC Selection
         {
         case 1:
            HumanPlayer.AttackGoblin();
            break;
         case 2:
            break;
         case 3:
            break;
         case 4:
            break;
         }
         break;
      case 3:
         HumanPlayer.HealPlayer();
         break;
      } //End of Menu-Selection
      cout<<endl<<endl<<"Continue playing the game? (Y/N) :\n";
      cin>>Continue;

      if(Continue == 'n' || Continue == 'N' || Continue == 'no' || Continue == 'No')
         {
            cout<<"*WARNING* - DO YOU WANT TO CONTINUE THE GAME? (Y/N) : \n";
            cin>>Continue;
         }
   } //End of menu loop
   while(Continue == 'y' || Continue == 'Y' || Continue == 'Yes' || Continue == 'yes');

   return 0;
}



Player.h : -

Code: Select all
class player
{
private: //Players Variables
   int CurrentHitpoints;
   int Hitpoints;
   int Strength;
   int Combat;
   int Experience; //1000 Experience per Combat Level
public:
   player();
   void LevelUp();
   void CheckStats();
   void HealPlayer();
   void AttackGoblin();
   void AttackTroll();
   void AttackOrge();
   void AttackDemon();
};


player.cpp : -

Code: Select all
#include "stdafx.h"
#include "player.h"
#include <windows.h>
#include <iostream>
using namespace std;

/*
Starting Stats
*/
   player::player():
   Hitpoints (10),
   CurrentHitpoints (10),
   Combat (3),
   Strength (1),
   Experience (0)
   {
   }

/*
Medical Centre
*/
void player::HealPlayer()
{
   cout<<endl<<"Welcome to the Medical Centre\n";
   Sleep(2000);
   cout<<endl;
   if(CurrentHitpoints != Hitpoints){
      cout<<"You seem to be injured, please wait while we refresh your hitpoints!\n"<<endl;
      Sleep(3000);
      cout<<"You are fully healed\n";
      CurrentHitpoints = Hitpoints;
   }
   else{
      cout<<"Your hitpoints are already full\n";
   }
}
/*
Player-Stat-Check
*/
void player::CheckStats()
{   
   cout<<endl<<"--------\n";
   cout<<" Stats \n";
   cout<<"--------\n";
   cout<<"Your Hitpoints level is : "<<CurrentHitpoints<<" / "<<Hitpoints<<endl;
   cout<<"Your Combat level is : "<<Combat<<endl;
   cout<<"Your Strength level is : "<<Strength<<endl;
   cout<<"You currently have : "<<Experience<<" Combat Experience"<<endl;
}

/*
First-Attackable-NPC, case 1
*/

void player::AttackGoblin()
{
   int PlayerDamage = 0;
   int GoblinDamage = 0;
   int GoblinStrength = 1;
   int GoblinHitpoints = 10;
   do{
   GoblinDamage += GoblinStrength*rand()%2;
   PlayerDamage += Strength*rand()%5;
   cout<<"Your turn to attack!\n";
   Sleep(750);
   cout<<"And you hit..... : "<<PlayerDamage<<" of damage"<<endl;
   GoblinHitpoints -= PlayerDamage;
   Sleep(750);
   cout<<"Goblin attacks second!\n";
   cout<<"And hits..... : "<<GoblinDamage<<" of damage"<<endl;
   CurrentHitpoints -= GoblinDamage;
   Sleep(750);
   if(CurrentHitpoints <=  0){
      cout<<endl<<"You have died to a goblin, better luck next time!\n";
      cout<<"You have lost 500 Experience Points\n"<<endl;
      Experience -= 500;
      Sleep(2000);
   }
   else if(GoblinHitpoints <= 0){
      player::LevelUp();
      Sleep(2000);
   }
   }
   while(CurrentHitpoints > 0 && GoblinHitpoints > 0); //Loops untill someone is dead
}

/*
Level-Up System
*/

void player::LevelUp()
{
      cout<<endl<<"You have won the fight\n";
      cout<<"You gain 500 Experience Points\n";
      Experience += 500; //500 Experience is gained after each fight

   for(;Experience >= 1000;) //Checks for 1000 experience
   {
      Combat += 1;
      Experience -= 1000; //Removes the experience once the combat level is gained
      cout<<"Congratulations you have reached : "<< Combat << " combat"<<endl;
}
}
`Sp3ke
 
Posts: 12
Joined: Sun May 25, 2008 10:09 am

Re: Project 3

Postby trx on Sat Dec 12, 2009 1:52 am

I have a question for you guys.
I'm totally new to programming, just watched antiRTFM's video #24th so far and wanted to get the bigger picture here. I'm wondering if I could actually program something like this "Project 3" if I finish all the video tutorials, or did you guys did alot more research outside of these videos. Thanks in advance.
trx
 
Posts: 2
Joined: Sat Dec 12, 2009 1:40 am

Re: Project 3

Postby noobgrammer on Sat Dec 12, 2009 8:08 am

depends on how creative you want to be. You could do project three just off the vids anti has given, but if you really want to learn then yes you will need to do further research than just hear.
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 198
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

PreviousNext

Return to Projects

Who is online

Users browsing this forum: No registered users and 0 guests