-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
54 lines (32 loc) · 1.02 KB
/
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
48
49
50
51
52
53
54
#ifndef GAME_H
#define GAME_H
#include <chrono>
#include <thread>
#include "inc.h"
#define FPS_INTERVAL 1.0 //seconds.
class Game : public Framework {
const Vector2d* windowSize;
const Vector2d* mapSize;
int numEnemies;
int numAmmo;
GameObjects* gameObj;
TextureManager* textrMan;
Timer* timer;
Timer fpsTimer;
int countedFrames = 0;
int fps_lasttime = getTickCount(); //the last recorded time.
int fps_current; //the current FPS.
int fps_frames = 0; //frames passed since the last recorded fps.
public:
Game(std::string window, std::string mapSize, int numEnemies, int numAmmo);
~Game();
virtual void PreInit(int& width, int& height, bool& fullscreen);
virtual bool Init();
virtual void Close();
virtual bool Tick();
virtual void onMouseMove(int x, int y, int xrelative, int yrelative);
virtual void onMouseButtonClick(FRMouseButton button, bool isReleased);
virtual void onKeyPressed(FRKey k);
virtual void onKeyReleased(FRKey k);
};
#endif