1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
#include <iostream>
#include <string>
#include <vector>
#include <limits>
#include <fstream>
#include "Pet_Class.h"
#include "Player_Class.h"
#include "Game_Class.h"
#include "Prototypes.h"
using namespace std;
Player::Player(string PLAYERNAME,
float PLAYERMONEY): PlayerName(PLAYERNAME),
PlayerMoney(PLAYERMONEY)
{
}
Player::~Player()
{
}
Pet::Pet(string PETNAME,
float PETHEALTH,
float PETTHIRST,
float PETSTAMINA): petName(PETNAME),
petHealth(PETHEALTH),
petThirst(PETTHIRST),
petStamina(PETSTAMINA)
{
}
Pet::~Pet()
{
}
Game::Game(bool ISFIRSTSTARTUP): isFirstStartup(ISFIRSTSTARTUP)
{
}
Game::~Game()
{
}
int main()
{
Player player("Player1", 0);
Game game(true);
Pet pet("PetName", 100, 0, 100);
NewGameSetup(player, game, pet);
return 0;
}
/*
=============================
NewGameSetup()
This function is run when the
game is first started up
=============================
*/
void NewGameSetup(Player &player, Game &game, Pet &pet)
{
LoadGame(player, game, pet); // Loads the game so if the player started a game already then the game wont go through the startup again. This mainly is used to get isFirstStartup but also loads everything else.
//Debug
cout << player.PlayerName << endl;
cout << pet.petName << endl;
cout << pet.petHealth << endl;
cout << game.isFirstStartup << endl;
//End of debug
The output is:
Chay Hawk
Blank space, should be the pet name
0
1
no matter what i do it wont change, also i changed the 1 in the file to 0 and it didnt change when the program started up so what do i do?
if(game.isFirstStartup == false)
{
MainGame();
}
if(game.isFirstStartup == true)
{
cout << "Welcome to Text Pet, Lets get set up\n" << endl;
cout << "Please enter your name" << endl;
getline(cin, player.PlayerName);
cout << '\n';
cout << "Ok thank you " << player.PlayerName << " now please enter your pets name" << endl;
getline(cin, pet.petName);
SaveGame(player, game, pet);
MainGame();
}
}
void MainGame()
{
cout << "MainGame Function debug test" << endl;
}
void PetStore()
{
}
void MainMenu()
{
int lv_choice;
cout << "TEXT PET\n" << endl;
cout << "1) " << endl;
switch(lv_choice)
{
}
}
|