-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_controller_h.h
48 lines (38 loc) · 1013 Bytes
/
game_controller_h.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
#pragma once
#include<glew.h>
#include<glfw3.h>
#include<vector>
#include"game_level_h.h"
#include "constants_h.h"
enum class STATE{ACTIVE,MENU,WIN,FAILURE};
class GameController {
public:
STATE state;
GLboolean keys[1024];
GLuint width, height;
GameController(GLuint width, GLuint height) {
this->width = width;
this->height = height;
state = STATE::ACTIVE;
currentLevel = 0;
levels = {};
}
void Initialize();
void InputProcessing(GLfloat delta);
void Update(GLfloat delta);
void Render();
vector<Level> levels;
GLuint currentLevel;
private:
//Loads fresh textures
void loadLevelTextures(const char* tBackground, const char* tPaddle, const char* tTile, const char* tTileSolid, const char* tBall);
void init_loadLevels_RAW();
//void loadLevelDataFromFiles();
void loadLevelDataFromFile(GLuint levelIndex);
void collisionAssessment();
Level getCurrentLevel();
void addLevel(Level level);
void drawCurrentLevel();
void loadLevel(int levelIndex);
void loadMenu();
};