This repository was archived by the owner on Sep 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
79 lines (53 loc) · 1.65 KB
/
Copy pathmain.cpp
File metadata and controls
79 lines (53 loc) · 1.65 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
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
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
#include "Screens.h"
#include "ConnectionManager.h"
#include <time.h>
#include "enemyReader.h"
#include "options.h"
using namespace sf;
int main(){
//EnemyReader e;
//e.getCurrentLevel();
//e.getNextEnemySet();
std::vector<Screen*> screens;
int screen = 0;
RenderWindow window(VideoMode(1366,768), "XeonWars", sf::Style::Close | sf::Style::Titlebar);
window.setView(Utils::calcView(window.getSize(), Utils::designedsize));
window.setFramerateLimit(60);
window.setMouseCursorVisible(false);
sf::Image icon;
//icon.loadFromFile("Resources/menu/icon.png");
//window.setIcon(256,256,icon.getPixelsPtr());
//window.requestFocus();
Options* gameOptions = new Options();
//Screens preparations
Menu menu;
screens.push_back(&menu);
Game game;
ConnectionManager* myConnectionManager = ConnectionManager::createInstance(&game);
screens.push_back(&game);
GameOverScreen gameOverScreen;
screens.push_back(&gameOverScreen);
PauseScreen pauseScreen;
screens.push_back(&pauseScreen);
OptionsScreen optionsScreen;
screens.push_back(&optionsScreen);
CreditsScreen creditsScreen;
screens.push_back(&creditsScreen);
RankingScreen rankingScreen;
screens.push_back(&rankingScreen);
Texture pauseTexture;
//Main loop
while (screen >= 0)
{
if (screen == 3)
game.pauseGame();
if (screen == 0) {
game.restartGame();
}
screen = screens[screen]->run(window, pauseTexture, gameOptions);
}
return EXIT_SUCCESS;
}