HeadBall  1.0
A game
InstructionsState.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <SFML/Graphics.hpp>
4 #include <string>
5 #include <sstream>
6 
7 #include "State.hpp"
8 #include "Game.hpp"
9 
10 namespace HeadBall {
16  class InstructionsState : public State {
17  public:
24 
29  void init ( );
30 
36  std::string displayInstructions ( );
37 
42  void handleInput ( );
43 
48  void update ( );
49 
54  void draw ( );
55 
56  private:
58 
59  sf::Sprite _background;
60  sf::Sprite _backBtn;
61  sf::Sprite _exitBtn;
62 
63  sf::Sound _btnClickSfx;
64 
65  sf::Text _instructionsText;
66  std::stringstream ss;
67 
68  };
69 }
Derived class of State class with visibility mode public that provides a state to instuct the players...
Definition: InstructionsState.hpp:16
void update()
Updates the state according to the input.
Definition: InstructionsState.cpp:106
void handleInput()
Handles input.
Definition: InstructionsState.cpp:59
sf::Sprite _backBtn
Button to return back.
Definition: InstructionsState.hpp:60
void draw()
Draws SFML objects of Instruction state.
Definition: InstructionsState.cpp:108
GameDataRef _data
The shared pointer for all the game data.
Definition: InstructionsState.hpp:57
std::string displayInstructions()
Takes instruction to be displayed in the window and returns it.
Definition: InstructionsState.cpp:93
std::stringstream ss
String stream to update the controls as in definitions.hpp.
Definition: InstructionsState.hpp:66
void init()
Initializes a new InstructionsState object.
Definition: InstructionsState.cpp:10
sf::Text _instructionsText
Text to display instructions information.
Definition: InstructionsState.hpp:65
sf::Sprite _exitBtn
Button to exit from the game.
Definition: InstructionsState.hpp:61
sf::Sound _btnClickSfx
Sound effect for button click.
Definition: InstructionsState.hpp:63
sf::Sprite _background
Background sprite to draw on the screen
Definition: InstructionsState.hpp:59
InstructionsState(GameDataRef data)
Construct a new Instructions State object.
Definition: InstructionsState.cpp:8
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