-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.cpp
49 lines (42 loc) · 1.23 KB
/
game.cpp
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
#include <iostream>
#include <string.h>
#include "functions.h"
using namespace std;
#define CMDCOUNT 3
string cmds[CMDCOUNT][2] = {{"quit", "Quits the game.\n"},
{"help", "Displays the help message.\n"},
{"start", "Starts the game.\n"}};
void greeter() {
cout << "Welcome to Microbial Storm, the two-player adversarial strategy card game based on the microbial world!\nTo start the game, type \"start\" and hit enter, or type \"help\" for more commands.\n";
}
void quit() {
cout << "Thanks for playing!\n";
}
void help() {
for(int i=0; i<CMDCOUNT; i++) cout << cmds[i][0] << " - " << cmds[i][1];
}
void start() {
cout << "Starting!\n";
player p1, p2;
createCards();
createPlayer(p1, p2); // in functions
gameLoop(p1, p2);
cout << "You are back in the main menu.\n";
}
int main() {
string input;
greeter();
while(cin >> input) {
if(input == "quit") {
quit();
return 0;
}else if(input == "help") {
help();
}else if(input == "start") {
start();
}else {
cout << "Command not recognised, type \"help\" for a list of commands.\n";
}
}
return 0;
}