Click here to Skip to main content
15,888,330 members
Home / Discussions / Collaboration / Beta Testing
   

Collaboration / Beta Testing

 
GeneralRe: DirectX 10 Programmer Pin
CPallini4-Oct-09 0:20
mveCPallini4-Oct-09 0:20 
GeneralRe: DirectX 10 Programmer Pin
MrMcIntyre4-Oct-09 2:26
MrMcIntyre4-Oct-09 2:26 
GeneralRe: DirectX 10 Programmer Pin
Richard MacCutchan4-Oct-09 5:01
mveRichard MacCutchan4-Oct-09 5:01 
GeneralRe: DirectX 10 Programmer Pin
Pete O'Hanlon4-Oct-09 8:45
mvePete O'Hanlon4-Oct-09 8:45 
GeneralRe: DirectX 10 Programmer Pin
Rajesh R Subramanian25-Dec-09 5:00
professionalRajesh R Subramanian25-Dec-09 5:00 
GeneralRe: DirectX 10 Programmer Pin
#realJSOP28-Dec-09 9:48
mve#realJSOP28-Dec-09 9:48 
GeneralRe: DirectX 10 Programmer Pin
Rajesh R Subramanian28-Dec-09 18:21
professionalRajesh R Subramanian28-Dec-09 18:21 
QuestionTxt Based Rpg [modified] Pin
akosidandan24-Sep-09 14:44
akosidandan24-Sep-09 14:44 
Hello all
I would like to ask how to make a simple graphics for this txt based rpg I create . I was planning to make some via dark gdk . So my question would be if anyone would like to tell some basic sprite in dark gdk

below here is my game

<pre>
#include&lt;iostream&gt;
#include&lt;string&gt;
#include&lt;ctime&gt;
#include&lt;cstdlib&gt;

using namespace std;

// player class ///////////////////////
class player {

int getDamage( );
string getName( );
string getJob( );

public:

//player info
string p_name;
string p_job;

//player items;
int potion;
int manaPotion;
int powerPotion;

//player status
int p_lvl;
int p_damage;
int p_magicDamage;
int p_powerDamage;
int p_life;
int p_mana;
int p_power;
int p_xp;
int p_gold;
int p_maxXp;
int p_maxLife;
int p_maxMana;
int p_maxPower;

//constructor of the class
player ( );


};

//player contructor definition
player :: player( ){
p_maxLife = 30;
p_lvl = 1;
p_maxXp = 2;
p_xp = 0;
p_gold = 10;
p_name = getName ( );
p_job = getJob ( );
p_life = p_maxLife;
p_damage = getDamage ( );

if ( p_job == "Warrior" ){
p_maxMana = 5;
p_maxPower = 10;
p_magicDamage = 5;
p_powerDamage = 10;
p_mana = p_maxMana;
p_power = p_maxPower;
}else if ( p_job == "Assasin" ){
p_maxMana = 7;
p_maxPower = 7;
p_magicDamage = 7;
p_powerDamage = 7;
p_mana = p_maxMana;
p_power = p_maxPower;
}else{
p_maxMana = 10;
p_maxPower = 5;
p_magicDamage = 10;
p_powerDamage = 5;
p_mana = p_maxMana;
p_power = p_maxPower;
}
}

//get the player name
string player::getName( ) {
system ( "cls" );
cout&lt;&lt;"\tJourney Txt Fighting Game\n\n"
&lt;&lt;"What is your name : ";
string name;
cin&gt;&gt;name;
system ( "pause" );
return name;
}
//get the player choosen job
string player::getJob( ) {
int choice;
do{
system ( "cls" );
cout&lt;&lt;"\tJourney Txt Fighting Game\n\n"
&lt;&lt;"What job do you want :\n"
&lt;&lt;"[ 1 ] - Warrior\n"
&lt;&lt;"[ 2 ] - Assasin\n"
&lt;&lt;"[ 3 ] - Soolsa\n"
&lt;&lt;"Choice : ";
cin&gt;&gt;choice;
} while ( choice &lt; 1 || choice &gt; 3 );

system ( "pause" );

if ( choice == 1 ){
return "Warrior";
}else if ( choice == 2 ){
return "Assasin";
}else{
return "Soolsa";
}
}

//get the playerDamage
int player::getDamage( ) {
srand ( time ( 0 ) );
int damage = rand ( ) % 5 + 1; //get a rando number from 1 - 5
return damage;
}

// enemy class //////////////////////////////////////
class enemy {

int getDamage ( );
public :
//constuctor of the class
enemy ( );
//enemy status
int e_damage;
int e_life;
int e_maxLife;
};

//enemy class constructor definition
enemy ::enemy( ){
e_maxLife = 20;
e_life = e_maxLife;
e_damage = getDamage ( );
}

//get the enemy Damage
int enemy::getDamage( ) {
int damage;
if ( e_life &lt;= 5 ) {
damage = 10;
}else {
srand ( time ( 0 ) );
damage = rand ( ) % 5 + 1;// get a random number from 1 - 5
}
return damage;
}



//create a public object for the enemy and the player
player hero;
enemy villain;


//functions /////////////////////////////////
void menu ( );
string title ( );
void fight ( );
char switchTurn ( char turn );
int playerMove ( int &amp;heroLife , int &amp;heroDamage , int &amp;enemyLife );
void run ( int &amp;heroLife , int &amp;enemyMaxLife );
int useItems ( int &amp;heroLife , int &amp;potion , int &amp;manaPotion, int &amp;powerPotion , int &amp;mana , int &amp;power );
int attack ( int &amp;heroLife , int &amp;mana , int &amp;power , int &amp;enemyLife );
int enemyMove ( int &amp;heroLife , int enemyDamage );
void displayStatus (int &amp;xp , int &amp;gold , int &amp;maxXp );
void displayHp( );
void shop ( int &amp;gold , int &amp;potion , int &amp;manaPotion , int &amp;powerPotion);
void check ( int &amp;xp , int &amp;maxXp , int &amp;life , int &amp;maxLife , int &amp;mana , int &amp;maxMana , int &amp;power , int &amp;maxPower );

//main funtion of the program///////////////////////////////////
int main ( ) {

//main program flow menu
menu ( );

cin.ignore ( cin.rdbuf ( ) -&gt;in_avail ( ) + 1 );
return 0;
}

//return the title of the game
inline string title ( ){
return "\tJourney Txt Fighting Game\n\n";
}

//menu
void menu ( ){
int choice;
do {
system ( "cls" );
cout&lt;&lt;title ( )
&lt;&lt;"What do you want to do ? \n"
&lt;&lt;"[ 1 ] - fight an enemy\n"
&lt;&lt;"[ 2 ] - goto a shop\n"
&lt;&lt;"[ 3 ] - display character status\n"
&lt;&lt;"[ 4 ] - exit the game\n"
&lt;&lt;"Choice : ";
cin&gt;&gt;choice;
} while ( choice &lt; 1 || choice &gt; 4 );

switch ( choice ){

case 1 :
cout&lt;&lt;"Your are about to fight now an enemy \n";
system ( "pause" );
fight ( );
break;
case 2 :
cout&lt;&lt;"You are about to go in to a shop now\n";
system ( "pause" );
shop ( hero.p_gold , hero.potion , hero.manaPotion , hero.powerPotion );
break;
case 3 :
cout&lt;&lt;"Character info now loading.....\n";
system ( "pause" );
displayStatus ( hero.p_xp , hero.p_gold , hero.p_maxXp );
break;
case 4:
cout&lt;&lt;"Thanks for playing .......\n";
break;
}
}

//fight funtion
void fight ( ){
char playerTurn = 'x';
char enemyTurn = 'o';
char turn = playerTurn;
int life;
int faint = 0;
do {
if ( turn == playerTurn ){
life = playerMove ( hero.p_life , hero.p_damage , villain.e_life );
//change the turn
turn = switchTurn ( turn );
}else {
life = enemyMove ( hero.p_life , villain.e_damage );
//change the turn
turn = switchTurn ( turn );
}

}while ( life &gt; faint );

system ( "cls" );
cout&lt;&lt;title ( );

if ( hero.p_life &lt;= 0 ){
cout&lt;&lt;"GAME OVER YOU HAVE BEEN DEFEATED.....\n"
&lt;&lt;"To play again please restart the game....\n";
system ( "pause" );
}else{

cout&lt;&lt;"CONGRATULATION YOU DEFEAT THE ENEMY......\n"
&lt;&lt;"you have loot 1 gold .\n";
check ( hero.p_xp , hero.p_maxXp , hero.p_life , hero.p_maxLife , hero.p_mana , hero.p_maxMana , hero.p_power , hero.p_maxPower );
villain.e_life = villain.e_maxLife ;
hero.p_gold = hero.p_gold + 1;
system ( "pause" );
//go back to menu again
menu ( );
}


}

//switch the turn
char switchTurn ( char turn ) {
if ( turn == 'x')
return 'o';
else
return 'x';
}

int playerMove ( int &amp;heroLife , int &amp;heroDamage , int &amp;enemyLife ) {
int move;
int life;
do{
system ( "cls" );
displayHp ( );
cout&lt;&lt;"What is your move ?\n"
&lt;&lt;"[ 1 ] - attack the enemy\n"
&lt;&lt;"[ 2 ] - use items\n"
&lt;&lt;"[ 3 ] - run \n"
&lt;&lt;"Choice : ";
cin&gt;&gt;move;
} while ( move &lt; 1 || move &gt; 3 );

switch ( move ) {

case 1 :
life = attack ( hero.p_life , hero.p_mana , hero.p_power , villain.e_life );
return life;
break;
case 2 :
life = useItems ( hero.p_life , hero.potion , hero.manaPotion , hero.powerPotion , hero.p_mana , hero.p_power );
return life;
break;
case 3 :
run ( hero.p_life , villain.e_maxLife );
return life;
break;
}



}

void run ( int &amp;heroLife , int &amp;enemyMaxLife) {
displayHp ( );
cout&lt;&lt;"Escaped safely ....\n";
hero.p_life = heroLife;
villain.e_life = enemyMaxLife;
//go back to main menu
menu ( );
}

int useItems ( int &amp;heroLife , int &amp;potion , int &amp;manaPotion , int &amp; powerPotion , int &amp;mana , int &amp;power ){
int choice;
do{
system ( "cls" );
cout&lt;&lt;title ( )
&lt;&lt;"Inventory : \n"
&lt;&lt;"[ 1 ] - potion "&lt;&lt;potion&lt;&lt;" pcs\n"
&lt;&lt;"[ 2 ] - mana potion "&lt;&lt;manaPotion&lt;&lt;" pcs\n"
&lt;&lt;"[ 3 ] - power potion "&lt;&lt;powerPotion&lt;&lt;" pcs\n"
&lt;&lt;"What do you want to use : ";
cin&gt;&gt;choice;
} while ( choice &lt; 1 || choice &gt; 3 );

switch ( choice ) {
case 1 :
if ( potion &lt;= 0 ){
cout&lt;&lt;"Sorry out of stock\n";
system ( "pause" );
return heroLife;
}else{
cout&lt;&lt;"You have use a potion\n";
system ( "pause" );
heroLife = heroLife + 10;
potion--;
if ( heroLife &gt; hero.p_maxLife ){
heroLife = hero.p_maxLife ;
return heroLife;
}else{
return heroLife;
}
}
break;

case 2:
if ( manaPotion &lt;= 0 ){
cout&lt;&lt;"Sorry out of stock\n";
system ( "pause" );
return heroLife;
}else{
cout&lt;&lt;"You have use a mana potion\n";
system ( "pause" );
mana = mana + 10;
manaPotion--;
if (mana &gt;hero.p_maxMana ){
mana = hero.p_maxMana ;
return heroLife;
}else{
return heroLife;
}
}
break;

case 3:
if ( powerPotion &lt;= 0 ){
cout&lt;&lt;"Sorry out of stock\n";
system ( "pause" );
return heroLife;
}else{
cout&lt;&lt;"You have use a power potion\n";
system ( "pause" );
power = power + 10;
powerPotion--;
if (power &gt; hero.p_maxPower ){
power = hero.p_maxPower ;
return heroLife;
}else{
return heroLife;
}
}
break;
}
}




int attack ( int &amp; heroLife , int &amp;mana , int &amp;power , int &amp;enemyLife ){
int choice;
do{
system ( "cls" );
cout&lt;&lt;title ( )
&lt;&lt;"what do you want to use ?\n"
&lt;&lt;"[ 1 ] - normal attack\n"
&lt;&lt;"[ 2 ] - magic attack\n"
&lt;&lt;"[ 3 ] - power attack\n"
&lt;&lt;"choice : ";
cin&gt;&gt;choice;
} while ( choice &lt; 1 || choice &gt; 3 );

switch ( choice ) {
case 1 :
cout&lt;&lt;"You have inflicted a normal damage of "&lt;&lt;hero.p_damage &lt;&lt;" to your enemy\n";
system ( "pause" );
enemyLife = enemyLife - hero.p_damage ;
return enemyLife;
break;
case 2 :
if ( mana &lt;= 0 ){
cout&lt;&lt;"Sorry out of mana\n";
system ( "pause" );
return enemyLife;
}else {
cout&lt;&lt;"You have inflicted a magic damage of "&lt;&lt;hero.p_magicDamage &lt;&lt;" to your enemy\n";
system ( "pause" );
mana = mana - 1;
enemyLife = enemyLife - hero.p_magicDamage ;
return enemyLife;
}
break;
case 3:
if ( power &lt;= 0 ){
cout&lt;&lt;"Sorry out of power\n";
system ( "pause" );
return enemyLife;
}else {
cout&lt;&lt;"You have inflicted a power damage of "&lt;&lt;hero.p_powerDamage &lt;&lt;" to your enemy\n";
system ( "pause" );
enemyLife = enemyLife - hero.p_powerDamage ;
power = power - 1;
return enemyLife;
}
break;
}
return enemyLife;

}


int enemyMove ( int &amp;heroLife , int enemyDamage ){

system ( "cls" );
displayHp ( );
cout&lt;&lt;"The enemy inflicted damage of "&lt;&lt;enemyDamage&lt;&lt;" to your life.\n";
heroLife = heroLife - enemyDamage;
system ( "pause" );
return heroLife;

}

void displayStatus ( int &amp;xp , int &amp;gold , int &amp; maxXp ){
system ( "cls" );
cout&lt;&lt;title ( )
&lt;&lt;"Player Status \n"
&lt;&lt;"Player Name : "&lt;&lt;hero.p_name &lt;&lt;endl
&lt;&lt;"Player Job : "&lt;&lt;hero.p_job &lt;&lt;endl
&lt;&lt;"Player lvl : "&lt;&lt;hero.p_lvl &lt;&lt;endl
&lt;&lt;"HP : "&lt;&lt;hero.p_life &lt;&lt;endl
&lt;&lt;"MANA : "&lt;&lt;hero.p_mana &lt;&lt;endl
&lt;&lt;"POWER : "&lt;&lt;hero.p_power &lt;&lt;endl
&lt;&lt;"\ncurrent Gold : "&lt;&lt;gold &lt;&lt;endl
&lt;&lt;"Exp : "&lt;&lt;xp &lt;&lt;endl
&lt;&lt;"Exp to lvl up : "&lt;&lt;maxXp &lt;&lt;endl;
system ( "pause" );
//go back to menu
menu ( );
}

void displayHp ( ) {
system ( "cls" );
cout&lt;&lt;title ( )
&lt;&lt;"Player \n"
&lt;&lt;"HP : "&lt;&lt;hero.p_life &lt;&lt;endl
&lt;&lt;"MANA : "&lt;&lt;hero.p_mana &lt;&lt;endl
&lt;&lt;"POWER : "&lt;&lt;hero.p_power &lt;&lt;endl&lt;&lt;endl
&lt;&lt;"Enemy \n"
&lt;&lt;"HP : "&lt;&lt;villain.e_life &lt;&lt;endl&lt;&lt;endl&lt;&lt;endl;
}



void shop ( int &amp;gold , int &amp;potion , int &amp;manaPotion , int &amp;powerPotion ){
system ( "cls" );
int choice;
do {
cout&lt;&lt;title ( )
&lt;&lt;"Current gold : "&lt;&lt;gold&lt;&lt;endl
&lt;&lt;"what do you want to buy ?\n"
&lt;&lt;"[ 1 ] - &lt;potion&gt; restores 10 hp cost 5 gold\n"
&lt;&lt;"[ 2 ] - &lt;mana potion&gt; restores 2 mana cost 5 gold \n"
&lt;&lt;"[ 3 ] - &lt;power potion&gt; restores 2 power cost 5 gold\n"
&lt;&lt;"choice : ";
cin&gt;&gt;choice;
} while ( choice &lt; 1 || choice &gt; 3 );

switch ( choice ) {
case 1 :
if ( gold &gt; 0 ){
cout&lt;&lt;"You have buy a potion.\n"
&lt;&lt;"Thanks for buying.\n";
system ( "pause" );
potion++;
gold = gold - 5;
}else{
cout&lt;&lt;"Insufficient gold.\n";
system ( "pause" );
}
break;
case 2 :
if ( gold &gt; 0 ){
cout&lt;&lt;"You have buy a mana potion.\n"
&lt;&lt;"Thanks for buying.\n";
system ( "pause" );
gold = gold - 5;
manaPotion++;
}else{
cout&lt;&lt;"Insufficient gold.\n";
system ( "pause" );
}
break;
case 3:
if ( gold &gt; 0 ){
cout&lt;&lt;"You have buy a power potion.\n"
&lt;&lt;"Thanks for buying.\n";
system ( "pause" );
gold = gold - 5;
powerPotion++;
}else{
cout&lt;&lt;"Insufficient gold.\n";
system ( "pause" );
}
break;

}

//go back to menu
menu ( );
}

void check ( int &amp;xp , int &amp;maxXp , int &amp;life , int &amp;maxLife , int &amp;mana , int &amp;maxMana , int &amp;power , int &amp;maxPower ){

if ( xp &gt;= maxXp ){
system ( "cls" );
cout&lt;&lt;"CONGRATULATION YOU HAVE LVL UP .....\n";
life = life + 1;
maxLife = maxLife + 1 ;
mana = mana + 1;
maxMana = maxMana + 1;
power = power + 1;
maxPower = maxPower + 1 ;
maxXp = maxXp + 2;
}else
xp = xp + 1;

}

</pre>

Any comments or suggestion to make this game better is kindly appreciated

modified on Thursday, September 24, 2009 8:51 PM

AnswerRe: Txt Based Rpg Pin
Luc Pattyn24-Sep-09 15:06
sitebuilderLuc Pattyn24-Sep-09 15:06 
GeneralRe: Txt Based Rpg Pin
akosidandan29-Sep-09 1:47
akosidandan29-Sep-09 1:47 
QuestionBug in Spynet Pin
User 238229222-Jul-09 21:18
User 238229222-Jul-09 21:18 
QuestionBeta testers needed: Fun way of Website promotion Pin
Wim Jans17-Jul-09 3:06
Wim Jans17-Jul-09 3:06 
AnswerRe: Beta testers needed: Fun way of Website promotion Pin
luckystar0916-Aug-09 16:40
luckystar0916-Aug-09 16:40 
QuestionHelp me, please! Pin
thuonghasm10-Jun-09 0:49
thuonghasm10-Jun-09 0:49 
QuestionHow to share a nice collab / project wiki with a friend. Pin
Jarno Burger1-Jun-09 23:07
Jarno Burger1-Jun-09 23:07 
QuestionTesters and feedback wanted for requirements planning application Pin
SoftwareMonkeys30-May-09 1:18
SoftwareMonkeys30-May-09 1:18 
QuestionCan someone test gmail's imap? Pin
Quake2Player27-May-09 4:15
Quake2Player27-May-09 4:15 
QuestionTDP setting RTRT tool for C++ Pin
maheesh25-May-09 17:14
maheesh25-May-09 17:14 
GeneralDos [modified] Pin
BenJamming18-May-09 7:49
BenJamming18-May-09 7:49 
GeneralHelp Add-in Beta Test Pin
pelnor28-Mar-09 7:53
pelnor28-Mar-09 7:53 
QuestionLoad testing using VSTS 2008 Pin
Viky_Tester19-Mar-09 2:06
Viky_Tester19-Mar-09 2:06 
QuestionLoad testing in VS .net 2008 Pin
Ash_VCPP19-Mar-09 1:51
Ash_VCPP19-Mar-09 1:51 
News[SixPack library] Beta testers wanted! Pin
sklivvz14-Mar-09 12:13
sklivvz14-Mar-09 12:13 
GeneralRe: [SixPack library] Beta testers wanted! Pin
hairy_hats20-Mar-09 1:24
hairy_hats20-Mar-09 1:24 
AnswerRe: [SixPack library] Beta testers wanted! Pin
sklivvz20-Mar-09 3:43
sklivvz20-Mar-09 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.