Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <windows.h>
- #include "Menu.hpp"
- #include <cstdlib>
- using namespace std;
- string strImie;
- int nKlasa;
- int nMenu;
- int nWiek;
- //Wczytywanie gry
- /*class Save
- {
- public:
- void save()
- {
- sejw.open("savefile.txt", ios::out);
- sejw << WARTOSC << endl;
- sejw.close();
- sejw.clear;
- exit(0);
- }
- }
- int main ()
- {
- sejw.open("savefile.txt", ios::in)
- if(sejw.good()==false)
- {
- cout<<"Plik z zapisem nie istnieje";
- getch();
- exit(0);
- }
- }
- */
- // Gra
- void Gra()
- {
- if (nKlasa == 1);
- cout << "Gratulacje! Wybrales klase Rycerz." << endl; //Ustawic aby wyswietlala sie jedna opcja
- if (nKlasa == 2);
- cout << "Gratulacje! Wybrales klase Lucznik." << endl;
- if (nKlasa == 3);
- cout << "Gratulacje! Wybrales klase Mag." << endl;
- }
- //Klasy
- void rycerz()
- {
- const int SILA = 10;
- const int ZRECZNOSC = 4;
- const int MAGIA = 0;
- }
- void lucznik()
- {
- const int SILA = 4;
- const int ZRECZNOSC = 10;
- const int MAGIA = 0;
- }
- void mag()
- {
- const int SILA = 0;
- const int ZRECZNOSC = 0;
- const int MAGIA = 10;
- }
- void profil()
- {
- cout << endl;
- cout << "Moze opowiesz cos o sobie?" << endl;
- cout << "Podaj swoje imie: "; cin >> strImie;
- cout << "Podaj swoj wiek: "; cin >> nWiek;
- cout << endl;
- Sleep(1000);
- cout << "Czas wybrac klase postaci. Oto twoje opcje:" << endl;
- cout << endl;
- Sleep(3000);
- cout << "Rycerz:" << endl;
- cout << "Sila: 10" << endl;
- cout << "Zrecznosc: 4" << endl;
- cout << "Magia: 0" << endl;
- cout << endl;
- Sleep(2000);
- cout << "Lucznik:" << endl;
- cout << "Sila: 4" << endl;
- cout << "Zrecznosc: 10" << endl;
- cout << "Magia: 0" << endl;
- cout << endl;
- Sleep(2000);
- cout << "Mag:" << endl;
- cout << "Sila: 0" << endl;
- cout << "Zrecznosc: 0" << endl;
- cout << "Magia: 10" << endl;
- cout << endl;
- //Wybor klasy
- cout << "Twoj wybor(1. Rycerz, 2. Lucznik, 3. Mag)"; cin >> nKlasa;
- switch (nKlasa)
- {
- case 1:
- rycerz(); break;
- case 2:
- lucznik(); break;
- case 3:
- mag(); break;
- }
- //Po wyborze klasy nastepuje przeniesienie do funkcji gry
- Gra();
- getch();
- }
- int main()
- {
- Sleep(300);
- cout <<
- "*********************************************" << endl;
- Sleep(300);
- cout << "Margonem V2.0" << endl;
- Sleep(300);
- cout <<
- "*********************************************" << endl;
- Sleep(300);
- cout << "Witaj w niezapomnianym swiecie. Twoja historia rozpoczyna" << endl;
- Sleep(300);
- cout << "sie po katastrofie statku na ktorym plynales." << endl;
- Sleep(300);
- cout << "Budzisz sie na plazy." << endl;
- Sleep(300);
- cout << endl;
- //Menu
- cout << "1. Rozpocznij gre" << endl;
- cout << "2. Wyjscie" << endl;
- cout << " Twoj wybor (1 lub 2)";
- cin >> nMenu;
- switch(nMenu)
- {
- case 1:
- profil();
- case 2:
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement