-
Notifications
You must be signed in to change notification settings - Fork 1
/
GameState.h
47 lines (41 loc) · 927 Bytes
/
GameState.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
#pragma once
#include<SFML/Graphics.hpp>
#include<SFML/Audio.hpp>
#include"State.h"
#include"Game.h"
#include"Pipe.h"
#include"Land.h"
#include"Bird.h"
#include"Collision.h"
#include"Flash.h"
#include"HUD.h"
namespace game
{
class GameState:public State
{
public:
GameState(GameDataRef data);
void Init();
void HandleInput();
void Update(float dt);
void Draw(float dt);
private:
GameDataRef _data;
sf::Sprite _background;
Pipe *pipe;
Land *land;
Bird *bird;
Collision collision;
Flash *flash;
HUD *hud;
sf::Clock clock;
int _gameState;
int _score;
sf::SoundBuffer _hitSoundBuffer;
sf::SoundBuffer _wingSoundBuffer;
sf::SoundBuffer _pointSoundBuffer;
sf::Sound _hitSound;
sf::Sound _wingSound;
sf::Sound _pointSound;
};
}