-
Notifications
You must be signed in to change notification settings - Fork 0
/
Game.h
46 lines (37 loc) · 881 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
#pragma once
#include "Constants.h"
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include "Draw.h"
#include "glm/gtc/random.hpp"
#include "glm/gtc/noise.hpp"
#include "Bird.h"
#include "Pipe.h"
enum class GameState {
Welcome,
Running,
End
};
class Game
{
public:
Game(float &WIDTH,float &HEIGHT);
void processInput(GLFWwindow* window,float dt);
void update(float dt);
void draw();
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void mouse_callback(GLFWwindow* /* window */, double /* xpos */, double /* ypos */) {}
void scroll_callback(GLFWwindow* /* window */, double /* xoffset */, double /* yoffset */) {}
bool reset = false;
private:
GameState mode;
int score = 0;
glm::mat4 m_projection;
Bird bird;
Pipes pipes;
DrawRects endDrawer;
DrawRects side_blockDrawer;
float& WIDTH;
float& HEIGHT;
DrawRects gridDrawer;
};