Code:
#include <windows.h>
#include <iostream.h>
#include <stdlib.h>
#include <string>
unsigned short int happy;
unsigned short int excersize;
unsigned short int hunger;
unsigned short int obedience;
string dogname;
void start();
void instruction();
void begin();
void rename();
void gamemenu();
void dogplay();
void dogfeed();
void excersizedog();
void ignoredog();
void hitdog();
void statsdog();
void gamewon();
void gameover();
void endstats();
void start()
{
happy = 5;
excersize = 5;
hunger = 5;
obedience = 5;
string bori;
cout<<"Welcome to Dog Simulator V1.0\n\n";
cout<<"Press\n";
cout<<"\t1)Start Game\n";
cout<<"\t2)Instructions\n";
cout<<"\t3)Quit\n";
cout<<"Choice: ";
cin>>bori;
cin.ignore();
if ( bori == "2" )
{
instruction();
}
else if ( bori == "1" )
{
begin();
}
else if ( bori == "3" )
{
}
else
{
cout<<"Sorry choose b or i!!!\n\n";
start();
}
}
void begin()
{
string renameop;
dogname = "Cheeky";
cout<<"\nYou have been given the dog which you will look after!\n";
cout<<"The dogs name is " << dogname << " however you may re-name it for the time that\n";
cout<<"the dog is staying here.\n\n";
cout<<"Rename? y/n ";
cin>>renameop;
cin.ignore();
if ( renameop == "y" )
{
rename();
}
else if ( renameop == "n" )
{
gamemenu();
}
else
{
cout<<"Sorry, you were supposed to choose y or n!!!\n\n";
begin();
}
}
void gamemenu()
{
if ( hunger <= 0 )
{
gameover();
}
else if ( hunger >= 10 )
{
gamewon();
}
if ( happy <= 0 )
{
gameover();
}
else if ( happy >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
if ( obedience <= 0 )
{
gameover();
}
else if ( obedience >= 10 )
{
if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
if ( excersize <= 0 )
{
gameover();
}
else if ( excersize >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
int menuchoice;
const char *comment[] = {"Dogs comment: I don't like you\n\n", "Dogs comment: you smell\n\n", "Dogs comment: I'm getting used to your nasty smell\n\n", "Dogs comment: thats not you're real face is it\n\n", "Dogs comment: ...\n\n", "Dogs comment: i will never agree with you\n\n", "Dogs comment: I will never like you\n\n","","","",""};
cout<<comment[rand()%11];
cout<<"\n\nBelow is the game menu, of what you can do with " << dogname << "!\n\n";
cout<<comment[rand()%11] << "\n\n";
cout<<"Type\n";
cout<<"\t1)Feed Dog\n";
cout<<"\t2)Play with Dog\n";
cout<<"\t3)Excersize\n";
cout<<"\t4)Ignore Dog\n";
cout<<"\t5)Hit Dog\n";
cout<<"\t6)Dog Stats\n";
cout<<"\t7)Quit Game\n\n";
cout<<"Choice: ";
cin>>menuchoice;
cin.ignore();
if ( menuchoice == 1 )
{
dogfeed();
}
else if ( menuchoice == 2 )
{
dogplay();
}
else if ( menuchoice == 3 )
{
excersizedog();
}
else if ( menuchoice == 4 )
{
ignoredog();
}
else if ( menuchoice == 5 )
{
hitdog();
}
else if ( menuchoice == 6 )
{
statsdog();
}
else if ( menuchoice == 7 )
{
}
else
{
cout<<"Sorry you have to press a number, 1 to 6!\n\n";
gamemenu();
}
}
void dogfeed()
{
string foodchoice;
cout<<"\n\nFeed your dog!!!\n\n";
cout<<"Below are the options of what you can feed your dog. Type in the\n";
cout<<"number for what you want to feed " << dogname << " and press enter.\n";
cout<<"Or by typine menu, you will be taken to the game menu\n";
cout<<"to choose from!!!\n\n";
cout<<"\t1)Dog Food\n";
cout<<"\t2)Chicken Leg\n";
cout<<"\t3)Chicken Breast\n";
cout<<"\t4)Cheese\n";
cout<<"\t5)Ice Cream\n";
cout<<"\t6)Pizza\n";
cout<<"\t7)Marshmellows\n";
cout<<"\t8)Dog Poo\n";
cout<<"\t9)chunks of wood\n";
cout<<"\t10)Computer\n";
cout<<"\t11)Potatoes\n";
cout<<"\t12)Carrots\n";
cout<<"\t13)Beans\n";
cout<<"\t14)Rice\n";
cout<<"\t15)Crackers\n\n";
cout<<"Choice: ";
cin>>foodchoice;
cin.ignore();
cout<<"\n\n";
if ( foodchoice == "1" )
{
cout<<"You have fed " << dogname << " dogfood. " << dogname << " reluctantly eats the dog food\n";
cout<<dogname << "'s happiness has gone down by 2 points\n";
cout<<dogname << "'s hunger has reduced and goes up a point!\n";
cout<<dogname << " has lost 1 obedience point\n\n";
cout<<"Press ENTER\n\n";
happy--;
happy--;
hunger++;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "2" )
{
cout<<"You have fed " << dogname << " chicken Leg. " << dogname << " gladly eats chicken leg, but gets sick\n";
cout<<dogname << " has been sick, happiness has gone down by 1 point\n";
cout<<dogname << " has been sick and hunger has increased, going down 2 points!\n";
cout<<dogname << " has lost one excersize point\n";
cout<<dogname << " has lost one obedience point\n\n";
cout<<"Press ENTER\n\n";
happy--;
hunger--;
hunger--;
excersize--;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "3" )
{
cout<<"You have fed " << dogname << " chicken Breast. " << dogname << " gladly eats chicken breast, but eats a bone\n";
cout<<dogname << " has swallowed a bone and happiness has gone down by 3 point\n";
cout<<dogname << " has eaten bone, giving extra energy, hunger decreases and 3 points of hunger gained\n";
cout<<dogname << " has gained 1 obedience point!\n\n";
cout<<"Press ENTER\n\n";
happy--;
happy--;
happy--;
hunger++;
hunger++;
hunger++;
obedience++;
cin.get();
gamemenu();
}
else if ( foodchoice == "4" )
{
cout<<"You have fed " << dogname << " Cheese. " << dogname << " eats cheese and gets a bad stomach\n";
cout<<dogname << " has had bad poos, happiness has gone up by 2 points\n";
cout<<dogname << " has been pooing and hunger has increased, going down 2 points!\n";
cout<<dogname << " has lost 2 obedience points\n\n";
cout<<"Press ENTER\n\n";
happy++;
happy++;
hunger--;
hunger--;
obedience--;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "5" )
{
cout<<"You have fed " << dogname << " Ice Cream. " << dogname << " gobbles down Ice Cream, which\n";
cout<<"freezes his stomach!!!\n";
cout<<dogname << "'s stomach has frozen and happiness has gone down by 1 point\n";
cout<<dogname << " has eaten Ice Cream and hunger has decreased, going down 2 points!\n";
cout<<dogname << "'s obedience has dropped by 1 point\n\n";
cout<<"Press ENTER\n\n";
happy--;
hunger++;
hunger++;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "6" )
{
cout<<"You have fed " << dogname << " Pizza. " << dogname << " eats pizza, and burns his tongue\n";
cout<<dogname << " likes being burnt, happiness has gone up by 1 point\n";
cout<<dogname << " has rejected pizza, as it is too hot, hunger goes down a point\n";
cout<<dogname << " has lost 1 excersize points\n\n";
cout<<"Press ENTER\n\n";
happy++;
hunger--;
excersize--;
cin.get();
gamemenu();
}
else if ( foodchoice == "7" )
{
cout<<"You have fed " << dogname << " Marshmellows. " << dogname << " eats marshmellows which get stuck in his stomach\n";
cout<<dogname << " is in pain and happiness has gone down a point\n";
cout<<dogname << "'s stomach is jammed and is left hungry. Hunger down 2 point\n\n";
cout<<"Press ENTER\n\n";
happy--;
hunger--;
hunger--;
cin.get();
gamemenu();
}
else if ( foodchoice == "8" )
{
cout<<"You have fed " << dogname << " Dog Poo. " << dogname << " loves dog poo!!\n";
cout<<dogname << " has been sick, happiness has gone down by 1 point\n";
cout<<dogname << " has been sick and hunger has increased, going down 2 points!\n";
cout<<dogname << " now feels less obedient towards you! -1 obedience points\n\n";
cout<<"Press ENTER\n\n";
happy--;
hunger--;
hunger--;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "9" )
{
cout<<"You have fed " << dogname << " chunks of wood. " << dogname << " scoffs the wood\n";
cout<<dogname << " loves wood, happiness goes up by 2 points\n";
cout<<dogname << " wood is not nutritious and hunger increases, hunger down 1 point\n";
cout<<"Press ENTER\n\n";
happy++;
happy++;
hunger--;
cin.get();
gamemenu();
}
else if ( foodchoice == "10" )
{
cout<<"You have fed " << dogname << " Computer. " << dogname << " eats computer and gets electricuted\n";
cout<<dogname << " has been burnt, happiness goes down by 2 points\n";
cout<<dogname << " Computer is filling, hunger decreases. 1 hunger point increased\n";
cout<<dogname << " has lost 2 obedience points\n\n";
cout<<"Press ENTER\n\n";
happy--;
happy--;
hunger++;
obedience--;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "11" )
{
cout<<"You have fed " << dogname << " Potato. " << dogname << " eats potato which is slightly mouldy\n";
cout<<dogname << " eats potato, and happiness stays the same\n";
cout<<"Potato is mouldy and causes stomach soars. -1 happiness points\n";
cout<<dogname << " eats potato and hunger decreases. 1 Hunger point added\n";
cout<<dogname << " has lost 1 excersize point!\n\n";
cout<<"Press ENTER\n\n";
happy--;
hunger++;
cin.get();
gamemenu();
}
else if ( foodchoice == "12" )
{
cout<<"You have fed " << dogname << " Carrots. " << dogname << " eats carrots, which he is allergict to!\n";
cout<<dogname << " has been sick, -2 happiness points\n";
cout<<dogname << " has been sick, and hunger increases. -2 hunger points\n";
cout<<dogname << "'s obedience has dropped by 1 point\n\n";
cout<<"Press ENTER\n\n";
happy--;
happy--;
hunger--;
hunger--;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "13" )
{
cout<<"You have fed " << dogname << " Beans. " << dogname << " eats beans and dies\n";
cout<<dogname << " has died, but somehow wakes up however happiness goes down by 2 points\n";
cout<<dogname << " beans are quite filling, and bieng dead doesn't take energy.\n";
cout<<dogname << " hunger decreases, and gains 2 hunger points!!!\n";
cout<<dogname << "'s obedience has dropped by 1\n\n";
cout<<"Press ENTER\n\n";
happy--;
happy--;
hunger++;
hunger++;
obedience--;
cin.get();
gamemenu();
}
else if ( foodchoice == "14" )
{
cout<<"You have fed " << dogname << " Rice. " << dogname << " hates beans, and won't eat them.\n";
cout<<dogname << "'s happiness stays the same\n";
cout<<dogname << "'s hunger increases. -1 hunger points\n";
cout<<dogname << " is angry at the lack of excersize. -1 excersize point\n";
cout<<dogname << "'s excersize points have gone down by one\n\n";
cout<<"Press ENTER\n\n";
hunger--;
excersize--;
excersize--;
cin.get();
gamemenu();
}
else if ( foodchoice == "15" )
{
cout<<"You have fed " << dogname << " Crackers. " << dogname << " eats computer and can't digest them well\n";
cout<<dogname << " has stomach aches and happiness levels -2\n";
cout<<dogname << " is stuffed however. +3 hunger points\n";
cout<<dogname << "'s excersize points have decreased by 1\n\n";
cout<<"Press ENTER\n\n";
happy--;
happy--;
hunger++;
hunger++;
hunger++;
excersize--;
cin.get();
gamemenu();
}
}
void dogplay()
{
string playwhat;
cout<<"\n\nWhat do you want to do with your dog!!!\n\n";
cout<<"\t1)Throw it a ball\n";
cout<<"\t2)Have a little Tea Party\n";
cout<<"\t3)Play with a Frisby\n";
cout<<"\t4)Dress him up!\n";
cout<<"\t5)Main Menu\n\n";
cout<<"Choice: ";
cin>>playwhat;
cin.ignore();
if ( playwhat == "1" )
{
cout<<"You start playing throw the ball with " << dogname << "! You're having fun until\n";
cout<<"you throw the Ball too hard, and hurt " << dogname << ".\n\n";
cout<<dogname << "'s happiness points have gone down by one!\n";
cout<<dogname << "'s hunger has increased, and has lost 1 hunger point!\n";
cout<<dogname << "'s excersize has increased. +1 Excersize point!\n";
cout<<dogname << " now feel more obedient to you. +1 Obedience points!\n\n";
cout<<"Pressing ENTER will take you back to the main game menu\n\n";
happy--;
hunger--;
obedience++;
excersize++;
cin.get();
gamemenu();
}
else if ( playwhat == "2" )
{
cout<<"You have a little tea party " << dogname << ". " << dogname << " is\n";
cout<<"very, very bored.\n\n";
cout<<dogname << "'s happiness points have down up by one!\n";
cout<<dogname << "'s hunger has increased, and has lost 1 hunger point!\n";
cout<<dogname << "'s excersize has decreased by 1 point\n";
cout<<dogname << " now feels unsecure, about what sex you are!\n\n";
cout<<"Pressing ENTER will take you back to the main game menu\n\n";
happy--;
hunger--;
excersize--;
cin.get();
gamemenu();
}
else if ( playwhat == "3" )
{
cout<<"You start playing throw the Frisby with " << dogname << "! You're having fun until\n";
cout<<"you throw the Frisby too hard, and hurt " << dogname << "'s eye.\n\n";
cout<<dogname << "'s happiness points have down by 2\n";
cout<<dogname << "'s hunger has increased, and has lost 1 hunger point!\n";
cout<<dogname << "'s excersize has increased. +1 Excersize point!\n";
cout<<dogname << " now feel more less obedient to you. -1 Obedience points!\n\n";
cout<<"Pressing ENTER will take you back to the main game menu\n\n";
happy--;
happy--;
hunger--;
excersize++;
obedience--;
cin.get();
gamemenu();
}
else if ( playwhat == "4" )
{
cout<<"You start playing dressing up with " << dogname << "! it is fairly boring\n";
cout<<"but at least you have not hurt " << dogname << ".\n\n";
cout<<dogname << "'s happiness points have gone up by one!\n";
cout<<dogname << "'s hunger has increased, and has lost 1 hunger point!\n";
cout<<dogname << "'s excersize has decreased. -1 Excersize point!\n";
cout<<dogname << " now feel more obedient to you. +1 Obedience points!\n\n";
cout<<"Pressing ENTER will take you back to the main game menu\n\n";
happy++;
hunger--;
excersize--;
obedience++;
cin.get();
gamemenu();
}
else if ( playwhat == "5" )
{
cout<<"\n\n";
gamemenu();
}
else
{
cout<<"Sorry, you were supposed to choose 1 to 5!\n\n";
dogplay();
}
if ( hunger <= 0 )
{
gameover();
}
else if ( hunger >= 10 )
{
gamewon();
}
else if ( hunger == 1 )
{
cout<<"Watch out! You dog is very hungry!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( happy <= 0 )
{
gameover();
}
else if ( happy >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( happy == 1 )
{
cout<<"Watch out! You dog is very unhappy!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( obedience <= 0 )
{
gameover();
}
else if ( obedience >= 10 )
{
if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( obedience == 1 )
{
cout<<"Watch out! You dog is not very obedient towards you!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( excersize <= 0 )
{
gameover();
}
else if ( excersize >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( excersize == 1 )
{
cout<<"Watch out! You dog is needs some excersize!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
cin.get();
}
void excersizedog()
{
cout<<"\n\nHow do you want to excersize your dog!!!";
if ( hunger <= 0 )
{
gameover();
}
else if ( hunger >= 10 )
{
gamewon();
}
else if ( hunger == 1 )
{
cout<<"Watch out! You dog is very hungry!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( happy <= 0 )
{
gameover();
}
else if ( happy >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( happy == 1 )
{
cout<<"Watch out! You dog is very unhappy!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( obedience <= 0 )
{
gameover();
}
else if ( obedience >= 10 )
{
if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( obedience == 1 )
{
cout<<"Watch out! You dog is not very obedient towards you!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( excersize <= 0 )
{
gameover();
}
else if ( excersize >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start()
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( excersize == 1 )
{
cout<<"Watch out! You dog is needs some excersize!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
cin.get();
}
void ignoredog()
{
cout<<"\n\nYou ignore " << dogname << ". It's happiness rises by one, but its\n";
cout<<"obedience drops be one.\n\n";
happy++;
obedience--;
if ( hunger <= 0 )
{
gameover();
}
else if ( hunger >= 10 )
{
gamewon();
}
else if ( hunger == 1 )
{
cout<<"Watch out! You dog is very hungry!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( happy <= 0 )
{
gameover();
}
else if ( happy >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( happy == 1 )
{
cout<<"Watch out! You dog is very unhappy!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( obedience <= 0 )
{
gameover();
}
else if ( obedience >= 10 )
{
if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( obedience == 1 )
{
cout<<"Watch out! You dog is not very obedient towards you!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( excersize <= 0 )
{
gameover();
}
else if ( excersize >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( excersize == 1 )
{
cout<<"Watch out! You dog is needs some excersize!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
cin.get();
gamemenu();
}
void hitdog()
{
string hitchoice;
cout<<"You look around. Below are the objects available to hit " << dogname << " with\n\n";
cout<<"\t1)Shoe\n";
cout<<"\t2)Cup\n";
cout<<"\t3)Baseball Bat\n\n";
cout<<"Choice: ";
cin>>hitchoice;
cin.ignore();
if ( hitchoice == "1" )
{
cout<<"You hit " << dogname << " with a shoe. " << dogname << " likes being hit\n";
cout<<"by things\n";
cout<<dogname << "'s happiness has gone up by one point\n";
cout<<dogname << "'s hunger has increased. -1 hunger point\n";
cout<<dogname << " feels 1 point less obedient towards you\n\n";
cout<<"Pressing ENTER will take you back to the main menu\n\n";
happy++;
hunger--;
obedience--;
cin.get();
gamemenu();
}
else if ( hitchoice == "2" )
{
cout<<"You hit " << dogname << " with a cup. " << dogname << " likes being hit\n";
cout<<"by things, however the cup smashes in his face\n";
cout<<dogname << "'s happiness has down up by one point\n";
cout<<dogname << " has eaten some of the cup and hunger has decreased. +1 hunger point!\n";
cout<<dogname << " feels 1 point less obedient towards you\n\n";
cout<<"Pressing ENTER will take you back to the main menu\n\n";
happy++;
hunger++;
obedience--;
cin.get();
gamemenu();
}
else if ( hitchoice == "3" )
{
cout<<"You hit " << dogname << " with a Baseball bat. " << dogname << " likes being hit\n";
cout<<"by things, however the baseball bat is too powerfull\n";
cout<<dogname << "'s happiness has gone down by one point\n";
cout<<dogname << "'s hunger has increased. -1 hunger point\n";
cout<<dogname << " feels 1 point less obedient towards you\n\n";
cout<<"Pressing ENTER will take you back to the main menu\n\n";
happy--;
hunger--;
obedience--;
cin.get();
gamemenu();
}
else
{
cout<<"You were supposed to choose between 1 and 3\n\n";
hitdog();
}
if ( hunger <= 0 )
{
gameover();
}
else if ( hunger >= 10 )
{
gamewon();
}
else if ( hunger == 1 )
{
cout<<"Watch out! You dog is very hungry!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( happy <= 0 )
{
gameover();
}
else if ( happy >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start()
}
else
{
gamewon();
}
}
else if ( happy == 1 )
{
cout<<"Watch out! You dog is very unhappy!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( obedience <= 0 )
{
gameover();
}
else if ( obedience >= 10 )
{
if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( excersize == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( obedience == 1 )
{
cout<<"Watch out! You dog is not very obedient towards you!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
if ( excersize <= 0 )
{
gameover();
}
else if ( excersize >= 10 )
{
if ( obedience == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( happy == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else if ( hunger == 0 )
{
cout<<"Sorry one of you stats reached 0, you've lost\n\n";
start();
}
else
{
gamewon();
}
}
else if ( excersize == 1 )
{
cout<<"Watch out! You dog is needs some excersize!!!\n";
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
cin.get();
gamemenu();
}
void statsdog()
{
HANDLE hOut;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
cout<<"\n\nHere is " << dogname << "'s current stats!!!\n\n";
cout<<"\tHunger:\t\t";
SetConsoleTextAttribute(hOut,
FOREGROUND_GREEN);
cout<< hunger << "\n";
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
cout<<"\tHappiness:\t";
SetConsoleTextAttribute(hOut,
FOREGROUND_GREEN);
cout<< happy << "\n";
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
cout<<"\tExcersize:\t";
SetConsoleTextAttribute(hOut,
FOREGROUND_GREEN);
cout<< excersize << "\n";
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
cout<<"\tObedience:\t";
SetConsoleTextAttribute(hOut,
FOREGROUND_GREEN);
cout<< obedience << "\n\n";
SetConsoleTextAttribute(hOut,
FOREGROUND_RED |
FOREGROUND_GREEN |
FOREGROUND_BLUE);
cout<<"Pressing enter will take you back to the game menu!!!";
cin.get();
gamemenu();
}
void rename()
{
cout<<"\n\nWhat do you want you dogs new name to be!!!\n";
cout<<"Choice: ";
cin>>dogname;
cin.ignore();
if ( dogname == "kasper" )
{
cout<<"\nThe name " << dogname << " is a good name. Your dog likes this name and\n";
cout<<"it's happiness points have gone up by two!!!\n\n";
happy++;
happy++;
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
else if ( dogname == "alex" )
{
cout<<"\nThe name " << dogname << " is a good name. Your dog likes this name and\n";
cout<<"it's happiness points have gone up by two!!!\n\n";
happy++;
happy++ ;
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
else if ( dogname == "bazil" )
{
cout<<"Cheat activated!!!\n\n";
cout<<dogname << "'s points have all gone to max!!!\n\n";
happy++;
happy++;
happy++;
happy++;
hunger++;
hunger++;
hunger++;
hunger++;
excersize++;
excersize++;
excersize++;
excersize++;
obedience++;
obedience++;
obedience++;
obedience++;
cout<<"Press ENTER\n\n";
cin.get();
gamemenu();
}
else
{
cout<<"\nYour dog does not like the name " << dogname << " and it's happyness points\n";
cout<<"have dropped by one.\n"
cout<<"Press ENTER\n\n";
happy--;
cin.get();
gamemenu();
}
}
void gamewon()
{
cout<<"Congradulations, one of your dogs stats has reached 10 or more, you've won!!!\n\n";
cin.get();
start();
}
void gameover()
{
cout<<"Sorry one of your dogs stats reached 0. You've lost!!!";
cin.get();
start();
}
void instruction()
{
cout<<"\n\nInstructions\n\n";
cout<<"Welcome to the Instruction guide for Dog Simulator 1.0. These instructions\n";
cout<<"will be divided into paragraphs. At the end of each paragagraph, press enter\n";
cout<<"to reveal the next one.\n\n";
cin.get();
cout<<"The basic storyline of this game is that you are helping a friend by looking\n";
cout<<"after their dog for two weeks. Your mission is to feed it, excersize and\n";
cout<<"keeping it happy for when it's owner comes back.\n\n";
cin.get();
cout<<"The dog doesn't really like it's owner, which is why it's owner has given\n";
cout<<"the dog to you. He's really using you to make his dog happy. It's up to you\n";
cout<<"really if you like being used. If you do, go ahead, take good care of the\n";
cout<<"dog, if you don't make it hate you.\n\n";
cin.get();
cout<<"At the start of the game you can choose to re-name your dog from Cheeky to\n";
cout<<"something else. Your dog starts off on stats of 5 for everything. Your stats\n";
cout<<"are; happiness, hunger(10 is full up/bloated,) excersize(10 is fit,) and\n";
cout<<"obedience(10 is really obedient.)\n\n";
cin.get();
}
void endstats()
{
string endchoice;
cout<<"\n\nHere is " << dogname << "'s current stats!!!\n\n";
cout<<"\tHunger:\t\t" << hunger << "\n";
cout<<"\tHappiness:\t" << happy << "\n";
cout<<"\tExcersize:\t" << excersize << "\n";
cout<<"\tObedience:\t" << obedience << "\n\n";
cout<<"Press p to play again of q to quit\n";
cout<<"Choice: ";
cin>>endchoice;
cin.ignore();
if ( endchoice == "p" )
{
cout<<"\n\n";
start();
}
else if ( endchoice == "q" )
{
cout<<"Goodbye!!!";
}
else
{
cout<<"Sorry, you have to press p or q!\n\n";
endstats();
}
}
int main()
{
//Start function
start();
}
Thanks in advance