-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameManager.h
More file actions
61 lines (44 loc) · 1.2 KB
/
GameManager.h
File metadata and controls
61 lines (44 loc) · 1.2 KB
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
#ifndef GAMEMANAGER_H
#define GAMEMANAGER_H
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include<string>
#include <iostream>
#include "GameData.h"
#include "fstream"
class GameManager
{
public:
static GameManager& getInstance(); // Singleton instance
bool getIsGameOver() const { return isGameOver; }
void setIsGameOver(bool value);
bool getIsGamePaused() const { return isGamePaused; }
void setIsGamePaused(bool value);
bool getIsLevelCompleted() const { return isLevelCompleted; }
void setIsLevelCompleted(bool value);
void SetKeyPressed(sf::Keyboard::Key key);
bool GetKeyPressed(sf::Keyboard::Key key);
void loadData(GameData& gamedata);
void saveData(GameData& gamedata);
void changeSong(std::string songName, bool loop);
void playSound(std::string songName);
sf::Music track1;
//FileData getFile() {
// return file;
//}
//void keyReleased(sf::Keyboard::Key key);
public:
sf::Vector2f vectorZero = sf::Vector2f(0.0f, 0.0f);
private:
GameManager();
bool isGameOver;
bool isGamePaused;
bool isLevelCompleted;
sf::Keyboard::Key pressedKey;
std::ofstream outF;
std::ifstream inF;
sf::SoundBuffer soundBuffer;
sf::Sound sound;
~GameManager();
};
#endif // GAMEMANAGER_H