-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.h
125 lines (109 loc) · 2.21 KB
/
Game.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#pragma once
#include "HollowCylinder.h"
#include "Player.h"
#include "Cone.h"
#include "Box.h"
#include <windows.h>
#include <SFML/Graphics.hpp>
#include <SFML\Audio.hpp>
#include <string.h>
#include "map.h"
#include <math.h>
#include <time.h>
#include "Hud.h"
class Zlo2
{
public:
Zlo2();
int Act(float PlayerX, float PlayerZ, float time);//
//1 - game over
//2 - rdead
//3 - rdoshot
void SetStartParam();
float XShot();
bool Live;
void Init(Map *map);
void SoundsStop();
private:
void Move(float PlayerX, float PlayerZ, float time);
void Draw();
bool CheckPlayer(float PlayerX, float PlayerZ);
void WheelRotate(float time, bool Direction);
// void DoShot();
void CheckHP();
void GetDamage(int D);
friend void ChangeVolume(sf::Music *sound, float X, float Z, float PlayerX, float PlayerZ);
Cylinder wheel[4];
Box platform;
Box body;
Cylinder face;
Box HPBox;
float X;
float Z;
int MaxX;
int MinX;
int HP;
float Speed;
float timer;
short int DamageSoundCount;
float wheelX[4];
float platformX;
float bodyX;
float faceX;
float HPBoxX;
sf::Music SoundDamage1;
sf::Music SoundDamage2;
sf::Music SoundMove;
sf::Music SoundDie;
Map *map;
};
class Plot
{
public:
Plot();
~Plot();
bool Act(float _time);
void setClasses(Player *_player, Map *map, sf::Text &_subtitles);
int Counter;
private:
void GameOver();
bool End();
void ConeAct();
bool ZloAct();
void InitObj();
friend void ChangeVolume(sf::Music *sound, float X, float Z, float PlayerX, float PlayerZ);
Player *player;
Map *map;
sf::Text *subtitles;
Cone cone;
Box Zlo[6];
Zlo2 zlo2;
const int ZloXFirst = 1;
const int ConeMaxY = 26;
const int ConeMinY = 22;
bool ConeDirection;
float time;
sf::Music SoundStart;
sf::Music SoundWin;
sf::Music SoundDeath;
sf::Music *SoundMove;
};
class Game
{
public:
Game(Player &_player, Map &map);
~Game();
void Act(float time);
bool Started;
void DrawSprites(sf::RenderWindow &window);
short int getStatus();
private:
HollowCylinder cylinder;
Player *player;
Map *map;
Hud hud;
Plot plot;
void Game::Start();
sf::Text subtitles;
sf::Font font;
};