-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgamesession.hpp
61 lines (43 loc) · 1.39 KB
/
gamesession.hpp
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
/*
* gamesession.hpp
*
* Description: This file contains the necessary includes and declarations for the GameSession class,
* which manages the main game logic and controls the game flow.
* It includes the necessary header files for the VehicleWrapper, LogWrapper, and Map classes.
*
* Author: Brandon Xu
* Date: 2/28/23
*/
#include "VehicleWrapper.hpp"
#include "logwrapper.hpp"
#include "map.hpp"
class GameSession {
public:
GameSession(); // Constructor
void initializeWindow();
int runGame(); // Run iteration of game, returns session high score
void winConditionHandler(); // Handles frog death and level clear
void displayGameOverScreen();
void resetGame();
int calculateScore();
//Testing purposes
Frog getFrogPlayer();
void setLevelsCleared(int newLevel);
private:
int _score; // Score for a single run
int _sessionHighScore;
sf::Text scoreText; // On-screen score counter
int _levelsCleared; // Number of times player reached endzone
// Controllers for logs and vehicles
logWrapper _logController;
vehicleWrapper _vehicleController;
Frog _frogPlayer; // User
sf::RenderWindow _window; // Game window
sf::Font _font; // Game font
// Game state flags
bool _isGameOver;
bool _displayGameOver;
bool _quitGame; // User has chosen to quit the game
};
// Helper color animation function
sf::Color HSVtoRGB(float hue, float saturation, float value);