-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameOptions.h
75 lines (66 loc) · 2.24 KB
/
GameOptions.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
74
75
/*****************************************************************//**
* \file GameOptions.h
* \brief Game Options screen. Navigate to choose which game mode to play
*
* \author Chau Le
* \date July 2021
*********************************************************************/
#pragma once
#ifndef GAME_OPTIONS_H
#define GAME_OPTIONS_H
#include "StateScreen.h"
#include "GameBase.h"
#include "DropToTheBeatGame.h"
#include "EndlessGame.h"
#include "LimitedTimeGame.h"
#include "SprintGame.h"
#include "Settings.h"
#include "ResultScreen.h"
#include "Enums.h"
#include <SFML/Graphics.hpp>
/**
* Controls Game Options screen.
*/
class GameOptions : public StateScreen
{
private:
sf::Music previewMusic;
sf::Sprite songBackground;
sf::Text text;
bool choosingMap = false;
int cursorMap = 0; // a table of game
int cursorMode = 0;
const int modeCount = 4;
std::vector<fs::path> maps;
int mapRenderOffset = 0;
int prevMapRenderOffset = 0;
Button dropOnBeatGameButton = Button(sf::Text("Drop On Beat", assetManager->getFont("game font"), 50U));
Button limitedGameButton = Button(sf::Text("Limited Time", assetManager->getFont("game font"), 50U));
Button endlessGameButton = Button(sf::Text("Endless", assetManager->getFont("game font"), 50U));
Button sprintGameButton = Button(sf::Text("Sprint 40L", assetManager->getFont("game font"), 50U));
Button startButton = Button(sf::Text("Start", assetManager->getFont("game font"), 50U));
public:
GameOptions(StateManager &stateManager);
~GameOptions();
// StateScreen functions
//****************************************************
void tick(const float & dt, sf::RenderWindow& window);
void render(sf::RenderWindow& window);
void keyEvent(const float & dt, sf::Event event);
void mouseEvent(const float & dt, sf::RenderWindow& window, sf::Event event);
void mouseScrollEvent(const float & dt, sf::RenderWindow& window, sf::Event event);
/**
* Draw option out to window. If the cursor is on it, highlight it.
*
* \param window
* \param gameMode String to be displayed
* \param x
* \param y
* \param isHighlight
*/
void drawGameModeOption(sf::RenderTexture& window, std::string gameMode, int x, int y, bool isHighlight);
private:
void selectMap(int mapIndex);
void startGame();
};
#endif