-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
55 lines (41 loc) · 1.05 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
#include "SDL_Base.h"
#include "Define.h"
#include "FPS.h"
#include "Player.h"
#include "World.h"
int main() {
srand(SDL_GetTicks());
cout << "Welcome to Die Kurve" << endl;
cout << "Controls for player 1: left, right" << endl;
cout << "Controls for player 2: q, w" << endl;
cout << "Controls for player 3: t, y" << endl;
cout << "Controls for player 4: o. p" << endl << endl;
cout << "Do you want to load a previous game? [y/n]" << endl;
char load;
cin >> load;
int numP = 0;
if(load == 'n'){
cout << "Set the number of players to start:" << endl;
cin >> numP;
}else if(load == 'y'){
cout << "Loading game..." << endl;
}
SDL_Base theApp(numP, load);
return theApp.OnExecute();
//}
}
int SDL_Base::OnExecute() {
if(OnInit() == false) {
return -1;
}
SDL_Event Event;
while(Running) {
while(SDL_PollEvent(&Event)) {
OnEvent(&Event);
}
OnLoop();
OnRender();
}
OnCleanup();
return 0;
}