-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameState.h
74 lines (54 loc) · 1.43 KB
/
GameState.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#pragma once
#include "State.h"
#include "PauseMenu.h"
#include "TileMap.h"
#include "PlayerGUI.h"
#include "TextTagSystem.h"
class GameState :
public State
{
private:
sf::View view;
sf::Vector2i viewGridPosition;
sf::RenderTexture renderTexture;
sf::Sprite renderSprite;
sf::Font font;
PauseMenu* pauseMenu;
sf::Shader core_shader;
Player* player;
PlayerGui* playerGui;
std::vector<Enemy*> activeEnemies;
EnemySystem* enemySystem;
TileMap* tileMap;
// Systems:
TextTagSystem* textTagSystem;
// FPS counter:
sf::Text fps;
//private: Functions
void initDefferedRender();
void initView();
void initPauseMenu();
void initShaders();
void initPlayers();
void initPlayerGui();
void initEnemySystem();
void initTileMap();
void initSystems();
void initSoundEngine();
public:
//Constructor and Destructor:
GameState(StateData* state_data);
virtual ~GameState();
//Functions:
void updateView(const float& dt);
void updateInput(const float& dt);
void updatePlayerInput(const float& dt);
void updatePlayerGui(const float& dt);
void updatePauseMenuButtons();
void uodateTileMap(const float& dt);
void updatePlayer(const float& dt);
void updateEnemies(const float& dt);
void updateCombat(Enemy* enemy, const float& dt);
void update(const float& dt);
void render(sf::RenderTarget* target = nullptr);
};