-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.h
More file actions
64 lines (49 loc) · 1.12 KB
/
Game.h
File metadata and controls
64 lines (49 loc) · 1.12 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
62
63
#pragma once
#include "RoadMap.h"
#include "Setting.h"
#include "Exit.h"
using namespace sf;
enum MENU_OPTION{MENU_PLAY=0, MENU_SETTINGS, MENU_EXIT};
class Game{
private:
double screen_width;
double screen_height;
TextureManager* t_manager;
short menuGUIS;
Event event;
View view;
RenderWindow window;
unordered_map<short, Color> menuMainColor;
Texture menu_T;
Texture background_T;
Sprite menu_S;
Sprite background_S;
IntRect selected_cords;
Vector2f selected_position;
short option_selected;
IntRect options_cords[3];
Vector2f options_position[3];
short options_number;
short* options_indexes;
MainMenuOption** options;
void initWindow();
void initMenuTexture();
void initMenuSprite();
void initBackgroundTexture();
void initBackgroundSprite();
void initOptions();
public:
Game(double screen_w, double screen_h);
Game();
void update();
void updateCursor();
void updateSelected();
void render();
void renderBackground();
void renderOptions();
void renderSelected();
void renderCursor();
void moveSelected(bool up);
bool isOptionHovered(Vector2f cursor_pos, short option_index);
void start();
};