-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
63 lines (56 loc) · 2.02 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
/********************************************************************************
/ Project: Othello
/-------------------------------------------------------------------------------
/ By: Michael Fisher, 2019
================================================================================
/ File: main.cpp
/
/ Main executable for the game "Othello". Main loop serves as a hub for the
/ execution of the main source files for the Program. These includes:
/ - Board.cpp/h, a class file that controls the primary game logic and execution
/ - Main_menu.cpp/h, a source file that contains the main menu for the game and
/ serves as the activity hub for the end user
/ - Play.cpp/h, a source file that contains the primary play loop for the game
/ - Tutorial.cpp/h, a source file that contains a modified play loop for
/ educating end users on how to use the program
/ - mainIncludes.h, a header file that contains the majority of all needed SDL
/ default librarys, which includes:
/ - Includes.h
/ - Constants.h
/ - compgeom.h
/ - Surface.h
/ - Event.h
********************************************************************************/
#include <ctime>
#include "mainIncludes.h"
#include "Board.h"
#include "Main_menu.h"
#include "Play.h"
#include "Tutorial.h"
int main()
{
KeyPressed keypress;
Surface surface;
Event event;
Board board(surface);
Music game_music("sounds/classical.ogg");
//game_music.play();
while(1)
{
bool single = false;
bool multi = false;
bool help = false;
bool exit = false;
// main menu
if (!exit) main_menu(surface, event, keypress, single, multi, help, exit);
// single player game
if (single) Play(surface, event, board, keypress, single, exit);
// multi player game
if (multi) Play(surface, event, board, keypress, single, exit);
// tutorial
if (help) tutorial(surface, event, board, keypress, exit);
// terminates program
if (exit) break;
}
return 0;
}