-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGamePlay.h
More file actions
59 lines (42 loc) · 1.12 KB
/
GamePlay.h
File metadata and controls
59 lines (42 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
#pragma once
#include "GameState.h"
#include "MazeGenerator.h"
#include <iostream>
#include "GameStateManager.h"
#include "Player.h"
#include "EndPoint.h"
class GamePlay :public GameState
{
int width;
int height;
sf::Vector2f vertWallSize = sf::Vector2f(50, 100);
sf::Vector2f horWallSize = sf::Vector2f(100, 50);
int borderSize = 6;
int cellSize = 100;
sf::Color bgColor = sf::Color::Black;
sf::Color wallsColor = sf::Color(138, 25, 36);
sf::View viewPlay;
sf::View defaultView;
MazeGenerator mazeGenerator;
std::map<int, int> maze;
sf::RenderWindow* window;
GameStateManager* gameStateManager;
std::vector<sf::RectangleShape*> walls;
std::vector<sf::RectangleShape*> visibleWalls;
sf::Clock clock;
sf::Time playTime;
Player player;
float playerSpeed = 300.f;
EndPoint endPoint;
void DrawMaze();
void CalculateVisibleWalls();
public:
GamePlay(int width, int height, sf::RenderWindow* window, GameStateManager* gameStateManager);
void Init() override;
void Cleanup() override;
void Pause() override;
void Resume() override;
void GetEvents() override;
void Update() override;
void Display() override;
};