-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
87 lines (57 loc) · 1.44 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
80
81
82
83
84
85
86
#include "pch.h"
#include "CONFIGURATION.h"
#include "UI/MENU.h"
#include "GAME.h"
#include "general_purpose_func.h"
#include "Input.h"
#include "MAP_GEN/MapGen.h"
#include "Place.h"
int main()
{
sf::RenderWindow window(sf::VideoMode(WIN_LENGTH, WIN_HEIGHT), "Project");
Input::init_Input(&window);
GAME* game = GAME::getInstance();
game->setWindow(&window);
MapGen::set_gamepTr(game);
Entity player = game->make_player();
MENU menu(&window, *init_text());
MENUopt option;
sf::Music robo;
robo.openFromFile("../res/ost/robo.ogg");
//robo.play();
do
{
option = menu.show_menu_ret_opt();
switch (option)
{
case MENUopt::gameSTART:
{
bool backToMenu = false;
game->reset_visibility(player);
//game->Printer->print_field();
//game->make_level(Place::NULLConnector, true);
while (!backToMenu) // GAME LOOP ////////////////////////////
{
game->ecs->update_entity_systems(player);
game->ecs->clear_events();
game->reset_visibility(player);
game->Printer->print_field_with_camera(game->ecs->get_component<Position>(player));
} // END OF GAME LOOP ////////////////////////////
}
break;
case MENUopt::controls:
menu.show_controls();
break;
case MENUopt::credits:
menu.show_credits();
break;
case MENUopt::exitOPT:
break;
default:
break;
}
} while (option != MENUopt::exitOPT);
//std::cin.get();
GAME::DELETEinstance();
return 0;
}