Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <sstream>
- #include <ctime>
- #include <stdlib.h>
- #include <string>
- #include <random>
- #include <cstdlib>
- #include <windows.h>
- #ifdef __unix__
- # include <unistd.h>
- #elif defined _WIN32
- # include <windows.h>
- #define sleep(x) Sleep(1000 * x)
- #endif
- using namespace std;
- //Intro and Menu
- void Intro();
- void Menu();
- //Back to menu
- void BToMenu();
- //Functions
- void hunt();
- void MeatA();
- void Rest();
- //Rest and How much is awarded during Rest
- int rest = 10;
- int RAward = 1.00;
- //Menu
- int menu;
- //Random Meat Gen , Meat Count and Meat Awarded
- int Meat = 0;
- int MAward = 1.00;
- //Arrays Begin
- //Arrays End
- int main()
- {
- //Launches on start up
- Intro();
- Menu();
- return 0;
- }
- void Intro()
- {
- cout << "Welcome to the RPG Game by Karl O'Connor" << endl;
- //cout << "You need to level up to rank 10 to fight Jason" << endl;
- cout << "You need to hunt to find food to survive." << endl;
- cout << endl;
- cout << endl;
- }
- void Menu()
- {
- system("color e");
- cout << " Would you like to" << endl
- << "1. Hunt 2 . Rest 3. Quit" << endl
- << "You have " << Meat << " meat and you are " << rest << " tired" << endl;
- cin >> menu;
- if (menu == 1)
- {
- hunt();
- }
- if (menu == 2)
- {
- Rest();
- }
- if (menu == 3)
- {
- system("cls");
- system("color 4");
- cout << "QUITING" << endl;
- system("exit");
- }
- }
- void Rest()
- {
- if (rest == 10)
- {
- system("cls");
- cout << "You are not tired" << endl;
- cout << endl;
- Menu();
- }
- if (menu == 2)
- {
- if (rest != 10)
- {
- system("cls");
- rest += 5;
- cout << "Rest is now " << rest << endl;
- cout << endl;
- cout << endl;
- Menu();
- }
- }
- }
- void BToMenu()
- {
- Menu();
- }
- void hunt()
- {
- if (rest < 5)
- {
- system("cls");
- cout << "You need to rest";
- cout << endl;
- cout << endl;
- Menu();
- }
- if (menu == 1)
- {
- system("color 3");
- system("cls");
- cout << "HUNTING." << endl;
- sleep(1);
- system("cls");
- cout << "HUNTING.." << endl;
- sleep(1);
- system("cls");
- cout << "HUNTING..." << endl;
- sleep(1);
- system("cls");
- Meat += 1;
- rest -= 5;
- cout << "You gained 1 Meat. You currently have " << Meat << endl;
- sleep(2);
- BToMenu();
- }
- }
- void MeatA()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement