HeadBall  1.0
A game
PausedState.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 PausedState : public State {
14  public:
20  PausedState (GameDataRef data);
21 
26  void init ( );
27 
32  void handleInput ( );
33 
38  void update ( );
39 
44  void draw ( );
45 
46  private:
48 
49  sf::Sprite _background;
50  sf::Sprite _resumeBtn;
51  sf::Sprite _instructionsBtn;
52  sf::Sprite _exitBtn;
53 
54  sf::Sound _btnClickSfx;
55  sf::Music _theme;
56  };
57 }
Class for the screen to be displayed when game is paused.
Definition: PausedState.hpp:13
void init()
Initialize state related data.
Definition: PausedState.cpp:10
GameDataRef _data
Shared pointer of game data.
Definition: PausedState.hpp:47
sf::Sprite _exitBtn
Button to exit from the game.
Definition: PausedState.hpp:52
void update()
Update state data.
Definition: PausedState.cpp:122
sf::Sprite _background
Background sprite to draw on the screen.
Definition: PausedState.hpp:49
void draw()
Draw state objects.
Definition: PausedState.cpp:124
sf::Sprite _resumeBtn
Button to resume game.
Definition: PausedState.hpp:50
sf::Sprite _instructionsBtn
Button to go to instructions state.
Definition: PausedState.hpp:51
sf::Music _theme
Theme music.
Definition: PausedState.hpp:55
PausedState(GameDataRef data)
Construct a new Paused State object.
Definition: PausedState.cpp:8
void handleInput()
Handle user input.
Definition: PausedState.cpp:70
sf::Sound _btnClickSfx
Sound effect for button click.
Definition: PausedState.hpp:54
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< GameData > GameDataRef
The Shared Pointer of GameData Struct.
Definition: Game.hpp:39