555Martijn
Gebruiker
- Lid geworden
- 15 jun 2008
- Berichten
- 163
Code:
// Created by Martijn for learning purposes.
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
SetConsoleTitle(TEXT("4Crowns"));
int choice;
for (;;){
do {
menu:
cout << "\t\t\t================================" << endl;
cout << "\t\t\t Main Menu" << endl;
cout << "\t\t\t================================" << endl;
cout << "\t\t\t Menu Options: " << endl;
cout << "\t\t\t 1 - Fight!" << endl;
cout << "\t\t\t 2 - View Stats" << endl;
cout << "\t\t\t 3 - Purchase Equipment" << endl;
cout << "\t\t\t 4 - Quit Game" << endl;
cout << "\t\t\t================================" << endl;
cout << "\t\t\t\n"; // Spacer
cout << "\t\t\t Option: "; cin >> choice;
} while ( choice < '1' || choice > '4' && choice != 'q');
if (choice == 'q') break;
switch (choice) {
// Fight!
case '1':
int bchoice;
system("CLS");
cout << "\t\t\t==============================" << endl;
cout << "\t\t\t Battle Menu" << endl;
cout << "\t\t\t==============================" << endl;
cout << "\n\t\t\t Who do you want to battle?" << endl;
cout << "\t\t\t Crown1 - Level 2 (melee)" << endl;
cout << "\t\t\t Option: "; cin >> bchoice;
if ( bchoice == 'Crown1' | 'crown1' ) {goto Crown1;}
else {goto menu;}
// Crown1
Crown1:
int Crown1HP = 80;
system("CLS");
cout << "Crown1 has "<< Crown1HP << " hitpoints." << endl;
system("PAUSE");
char answer;
// View Stats
case '2':
cout << "empty" << endl;
// Purchase Equipment
case '3':
cout << "empty" << endl;
default:
cout << "empty" << endl;
return 0;
}}}
Sorry van de nog messy code, maar ik was bezig met het vecht systeem, en ik compile weer is om te testen, en nu heb ik iets kapot gemaakt waar ik niet mee bezig was 0_o.