-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cpp
executable file
·59 lines (47 loc) · 1.04 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
#include <SFML/Graphics.hpp>
#include "StateMgr.h"
#include "Res.h"
#include "MapMgr.h"
#include "Entity.h"
/*
*to do*
-get maps to load -**
-collision/physics
-make title screen
-make screen displaying current level before each level
-more levels
-make logo for myself
-make website
-RELEASE!!!!
*/
int main()
{
//init window
sf::RenderWindow window(sf::VideoMode(320, 448), "1_15");
window.setFramerateLimit(60);
//used to start game efficiently
bool gameStarted = false;
//load title screen
sf::Texture texture = loadTexture("1_15title.png");
sf::Sprite screen(texture);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
if (!gameStarted)
{
startMainMenuState(window, screen);
gameStarted = true;
}
updateState(window, screen);
if (state() == 2)
startMainMenuState(window, screen);
window.display();
}
gameStarted = false;
return 0;
}