-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.h
More file actions
47 lines (41 loc) · 996 Bytes
/
Game.h
File metadata and controls
47 lines (41 loc) · 996 Bytes
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
#ifndef DEF_GAME
#define DEF_GAME
#include <SFML/Graphics.hpp>
#include "Camera.h"
#include "GameObject.h"
#include "SceneComponent.h"
#include "Actor.h"
using namespace std;
class Game
{
public:
Game();
Game(float, sf::Vector2i, string);
void newLoop();
void endLoop();
sf::RenderWindow * getMainWindow();
void updateLogic();
void updateDraw();
void close();
bool isAlive();
void setCanClose(bool);
void setMainCamera(Camera*);
Camera* m_currentCamera;
sf::RenderWindow m_window;
void updatePhysics();
bool newSceneComponent(SceneComponent*);
bool newActor(Actor*);
void draw(sf::Sprite *);
void setBackgroundColor(sf::Color);
private:
sf::Text m_txtFPS;
bool m_canCloseMainWindow;
bool m_isOpen = true;
sf::Clock m_clock;
float m_framerate;
sf::Time m_startLoopTime;
vector<SceneComponent *> m_gameObjects;
vector<Actor *> m_gameActors;
sf::Color m_backgroundColor;
};
#endif