-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
81 lines (69 loc) · 1.82 KB
/
main.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*************************************************************************************
* Program NAme: main.cpp
* Author: George Lenz
* Date: 3/20/2018
* Description: runs a haunted house game
pictures in this game were used from:
http://www.chris.com/ascii/joan/www.geocities.com/SoHo/7373/haloween.html
*************************************************************************************/
#include <iostream>
#include <string>
#include <stdlib.h>
#include "spaces.hpp"
#include "space1.hpp"
#include "character.hpp"
#include "space2.hpp"
#include "space3.hpp"
#include "space4.hpp"
#include "space5.hpp"
#include <queue>
#include "space6.hpp"
#include "dracula.hpp"
#include "validate.hpp"
#include "game.hpp"
using namespace std;
int main()
{
Game* game;
do
{
//create a game
game = new Game();
//menu
game->printMenu();
if(game->getMenuChoice() == 1)
{
//instructions
game->printInstruct();
//print display
system("clear");
game->printSpace();
//move character and update
while(game->getInput()!='q')
{
//get input, decrease health for step
game->userInput();
game->stepPenalty();
system("clear");
//Move
game->move();
//print current board and check to see if key was found
//or if there is action to be taken
game->printSpace();
game->spaceAction();
//check health and current game status
game->healthCheck();
if(game->getLoss() == 1)
{
break;
}
//print keys
game->printKeys();
}
}
//start a new game and clear memory
game->newGame();
delete game;
}while(game->getMenuChoice() !=2);
return 0;
}