HeadBall  1.0
A game
HalfTime.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SFML/Graphics.hpp>
4 
5 #include "State.hpp"
6 #include "Game.hpp"
7 
8 namespace HeadBall {
13  class HalfTime : public State {
14  public:
21  HalfTime (GameDataRef data, ScoreTimeRef scoretime);
22 
27  void init ( );
28 
33  void handleInput ( );
34 
39  void update ( );
40 
45  void draw ( );
46 
47  private:
50 
51  sf::Text _score;
52 
53  sf::Music _theme;
54  sf::Sound _btnClickSfx;
55 
56  sf::Sprite _background;
57  sf::Sprite _resumeBtn;
58  };
59 }
Class for Half Time State.
Definition: HalfTime.hpp:13
sf::Sound _btnClickSfx
Sound effect for button click.
Definition: HalfTime.hpp:54
sf::Text _score
Scores of the players displayed as text.
Definition: HalfTime.hpp:51
sf::Sprite _resumeBtn
Sprite for resume button.
Definition: HalfTime.hpp:57
GameDataRef _data
Shared pointer of all game data.
Definition: HalfTime.hpp:48
ScoreTimeRef _scoreTime
Shared pointer of the score and time.
Definition: HalfTime.hpp:49
void update()
Update state data.
Definition: HalfTime.cpp:79
void handleInput()
Handle user input.
Definition: HalfTime.cpp:54
void draw()
Draw state objects.
Definition: HalfTime.cpp:81
sf::Music _theme
The theme music.
Definition: HalfTime.hpp:53
HalfTime(GameDataRef data, ScoreTimeRef scoretime)
Construct a new Half Time object.
Definition: HalfTime.cpp:9
sf::Sprite _background
Background sprite to draw on screen.
Definition: HalfTime.hpp:56
void init()
Initialize state related data.
Definition: HalfTime.cpp:11
Abstract based class which inherits all the states of the game.
Definition: State.hpp:8
Custom namespace used throughout the project.
Definition: AboutState.cpp:6
std::shared_ptr< ScoreTimeData > ScoreTimeRef
The Shared Pointer of ScoreTimeData struct.
Definition: Game.hpp:45
std::shared_ptr< GameData > GameDataRef
The Shared Pointer of GameData Struct.
Definition: Game.hpp:39