-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
44 lines (36 loc) · 1.04 KB
/
Copy pathmain.cpp
File metadata and controls
44 lines (36 loc) · 1.04 KB
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
// Includes
//******************************************************************
#include "SDL.h"
#include "controller/TheGame.h"
// Main: This should need no explanation
//******************************************************************
int main(int argc, char* args[]){
TheGame controller;
enum gameStates {INTRO, SELECT_SAVE_FILE, LEVEL_I, MENU, EXIT};
controller.setGameState(INTRO);
if(!controller.initialize()){
return 1;
}
while(controller.getGameState() != EXIT){
switch(controller.getGameState()){
case INTRO:
if(!controller.doIntro()){
return 1;
}
break;
case SELECT_SAVE_FILE:
controller.doSelectSave();
break;
case LEVEL_I:
if(!controller.doLevelI()){
return 1;
}
break;
case MENU:
controller.doMenu();
break;
};
}
controller.doExit();
return 0;
}