-
Notifications
You must be signed in to change notification settings - Fork 0
/
rythm.hpp
52 lines (42 loc) · 1.14 KB
/
rythm.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
#ifndef RYTHM_HPP
#define RYTHM_HPP
#include "heart.hpp"
#include "wave.hpp"
class Rythm
{
public:
Rythm();
~Rythm();
bool init(bool retry = false);
void update(sf::Time elapsedTime);
void draw(sf::RenderWindow &app);
void hurted();
void accelerate();
void decelerate(sf::Time elapsedTime);
void createWave();
void beatWave();
void generateWaves(sf::Time elapsedTime);
bool isTheEnd();
private:
sf::Texture _backgroundO, _waveO, _lineO;
sf::Sprite _background, _lineSprite;
sf::Time _elapsedTime, _deltaBeat, _elapsedTimeBeat, _elapsedTimeAccelerate, _deltaTimeWaves, _elapsedTimeWaves;
bool _isTheEnd;
int _totalWaves;
sf::SoundBuffer _buffer1;
sf::SoundBuffer _buffer2;
sf::Sound _heart1;
sf::Sound _heart2;
bool _firstHeart;
Heart _heart;
std::list<Wave*> _waves;
bool _security;
struct WaveDeallocator
{
void operator()(const Wave* p) const
{
delete p;
}
};
};
#endif