-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGame.h
48 lines (31 loc) · 989 Bytes
/
Game.h
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 GAME_H
#define GAME_H
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include "ResourceDispatcher.h"
#include "Player.h"
#include "LoadMap.h"
#include "TilesMap.h"
class Game
{
public:
//non copyable class
Game(const Game&) = delete;
Game& operator=(const Game&) = delete;
Game(); //< constructor
void init();
void run(int frame_per_seconds);
void runWithFixedTimeSteps(int frame_per_seconds = 60);
void runWithVariableTimeSteps();
void runWithMinimumTimeSteps(int minimum_frame_per_seconds = 30);
private:
void processEvents();//< Process events
void update(); //< do some updates
void update(sf::Time deltaTime);
void render();//< draw all the stuff
sf::RenderWindow _window; //< the window use to display the game
Player _player;
LoadMap map;
TilesMap tMap;
};
#endif