-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsceneManger.hpp
72 lines (68 loc) · 1.89 KB
/
sceneManger.hpp
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
#include "../Header/scenes.hpp"
#include "../Scenes/game.hpp"
#include "../Scenes/menu.hpp"
#include "../Scenes/GameOver.hpp"
#include "../Scenes/story.hpp"
#include "../Scenes/addedLater.hpp"
#include "../Scenes/anim1.hpp"
#include "../Scenes/anim2.hpp"
#include "../Scenes/pause.hpp"
#include "../Scenes/help.hpp"
#include "../Scenes/credits.hpp"
int updateScene() {
RenderWindow app(VideoMode(1200,800), "Pos:", Style::Close);
app.setFramerateLimit(50);
app.setVerticalSyncEnabled(true);
currentScene = mainMenu;
Font AmaticB;
AmaticB.loadFromFile("Resource/Fonts/Amatic-Bold.ttf");
Text endGameText("Game Over", AmaticB, 70);
endGameText.setOrigin(endGameText.getLocalBounds().width/2,
endGameText.getLocalBounds().height/2);
endGameText.setPosition(600, 400);
endGameText.setFillColor(Color::Red);
while (app.isOpen())
{
Event e;
while(app.pollEvent(e)){
if (e.type==Event::Closed){
app.close();
}
}
app.clear();
switch(currentScene){
case startingAnime:
anim1(app);
break;
case secondLevelAnime:
anim2(app);
break;
case gamePlay:
game(app);
break;
case gamePaused:
pause(app);
break;
case mainMenu:
game_dispose();
menu(app);
break;
case storyLine:
story(app);
break;
case helpPage:
help(app);
break;
case creditPage:
credit(app);
break;
case gameOver:
game_over(app, endGameText);
break;
default :
break;
}
app.display();
}
return 0;
}