diff --git a/a.exe b/a.exe new file mode 100644 index 0000000..293e3b0 Binary files /dev/null and b/a.exe differ diff --git a/dig.h b/dig.h index 428c8ea..9f91db9 100644 --- a/dig.h +++ b/dig.h @@ -38,6 +38,7 @@ public: c_w = c_w + 1; return c_w; } + return 0; } int count_f() { @@ -53,6 +54,7 @@ public: c_f= c_f + 1; return c_f; } + return 0; } int count_s() { @@ -68,6 +70,7 @@ public: c_s = c_s + 1; return c_s; } + return 0; } int shovel() { @@ -225,6 +228,7 @@ public: { inv.add_crops("tomatoes", 1);// add tomato to inventory } + return 0; } int harvest_cherry() @@ -249,6 +253,7 @@ public: { inv.add_crops("cherries", 1); // add cherry to inventory } + return 0; } void dig(string question) { diff --git a/inventory.exe b/inventory.exe new file mode 100644 index 0000000..1206d90 Binary files /dev/null and b/inventory.exe differ diff --git a/main.cpp b/main.cpp index 384930e..210e22b 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,5 @@ #include -#include "menu.h" +#include "menu2.h" #include "maingame.h" diff --git a/maingame.h b/maingame.h index f869854..4f4f683 100644 --- a/maingame.h +++ b/maingame.h @@ -4,7 +4,7 @@ #include #include "shop.h" #include "dig.h" -#include "menu.h" +#include "menu2.h" #include "shop.cpp" #include "shopsell.h" #include "lower.h" diff --git a/menu2.h b/menu2.h index 8d614f5..927a5ce 100644 --- a/menu2.h +++ b/menu2.h @@ -1,5 +1,5 @@ -#ifndef MENU_H -#define MENU_H +#ifndef MENU2_H +#define MENU2_H #include #include @@ -7,17 +7,18 @@ #include "inventory.h" #include using namespace std; +Inventory inv; class interface { protected: string answer; public: - string get_answer() //get and set method + void get_answer() //get and set method { cout << answer << endl; } - string set_answer(string ans) //class created to do oop, includes data and function + void set_answer(string ans) //class created to do oop, includes data and function { answer = ans; } @@ -25,7 +26,7 @@ public: }; -Inventory inv; + int menu() { @@ -84,15 +85,14 @@ int menu() - int index = 1; - while (index <= 5) //countdown from 5 and breaks out of loop and the game will now start. + int index = 5; + while (index <= 5 && index > 0) //countdown from 5 and breaks out of loop and the game will now start. { cout << index << endl; index--; } - Inventory inv; cout << "A new game will now begin and you will receive 100 sickles, some tools and a few seeds\n."; //code to give user 100 sickles, few seeds and tools to start the game here. diff --git a/menu2.h.gch b/menu2.h.gch new file mode 100644 index 0000000..375405d Binary files /dev/null and b/menu2.h.gch differ diff --git a/shop.cpp b/shop.cpp index 629a102..824d07a 100644 --- a/shop.cpp +++ b/shop.cpp @@ -1,3 +1,5 @@ +#ifndef SHOP_CPP +#define SHOP_CPP #include #include "shop.h" #include @@ -46,3 +48,5 @@ cin >> choice; //player can input their choice } } } + +#endif diff --git a/what.cpp b/what.cpp new file mode 100644 index 0000000..46966b7 --- /dev/null +++ b/what.cpp @@ -0,0 +1,8 @@ +#include +#include +#include "menu2.h" +int main() +{ + menu(); + +}