HeadBall  1.0
A game
Public Member Functions | Private Attributes | List of all members
HeadBall::InstructionsState Class Reference

Derived class of State class with visibility mode public that provides a state to instuct the players about basic controls of game. More...

#include <InstructionsState.hpp>

Inheritance diagram for HeadBall::InstructionsState:
Inheritance graph
Collaboration diagram for HeadBall::InstructionsState:
Collaboration graph

Public Member Functions

 InstructionsState (GameDataRef data)
 Construct a new Instructions State object. More...
 
void init ()
 Initializes a new InstructionsState object. More...
 
std::string displayInstructions ()
 Takes instruction to be displayed in the window and returns it. More...
 
void handleInput ()
 Handles input. More...
 
void update ()
 Updates the state according to the input. More...
 
void draw ()
 Draws SFML objects of Instruction state. More...
 
virtual void pause ()
 Virtual function for pausing the state. More...
 
virtual void resume ()
 Virtual function for resuming the object. More...
 
virtual void animate ()
 Vitrual function for performing animations. More...
 

Private Attributes

GameDataRef _data
 The shared pointer for all the game data. More...
 
sf::Sprite _background
 Background sprite to draw on the screen
More...
 
sf::Sprite _backBtn
 Button to return back. More...
 
sf::Sprite _exitBtn
 Button to exit from the game. More...
 
sf::Sound _btnClickSfx
 Sound effect for button click. More...
 
sf::Text _instructionsText
 Text to display instructions information. More...
 
std::stringstream ss
 String stream to update the controls as in definitions.hpp. More...
 

Detailed Description

Derived class of State class with visibility mode public that provides a state to instuct the players about basic controls of game.

Constructor & Destructor Documentation

◆ InstructionsState()

HeadBall::InstructionsState::InstructionsState ( GameDataRef  data)

Construct a new Instructions State object.

Parameters
dataThe shared pointer of GameData

Member Function Documentation

◆ animate()

virtual void HeadBall::State::animate ( )
inlinevirtualinherited

Vitrual function for performing animations.

◆ displayInstructions()

std::string HeadBall::InstructionsState::displayInstructions ( )

Takes instruction to be displayed in the window and returns it.

Returns
std::string returns the instructions

◆ draw()

void HeadBall::InstructionsState::draw ( )
virtual

Draws SFML objects of Instruction state.

Implements HeadBall::State.

◆ handleInput()

void HeadBall::InstructionsState::handleInput ( )
virtual

Handles input.

Implements HeadBall::State.

◆ init()

void HeadBall::InstructionsState::init ( )
virtual

Initializes a new InstructionsState object.

Implements HeadBall::State.

◆ pause()

virtual void HeadBall::State::pause ( )
inlinevirtualinherited

Virtual function for pausing the state.

Reimplemented in HeadBall::GameState.

◆ resume()

virtual void HeadBall::State::resume ( )
inlinevirtualinherited

Virtual function for resuming the object.

Reimplemented in HeadBall::GameState.

◆ update()

void HeadBall::InstructionsState::update ( )
virtual

Updates the state according to the input.

Implements HeadBall::State.

Member Data Documentation

◆ _backBtn

sf::Sprite HeadBall::InstructionsState::_backBtn
private

Button to return back.

◆ _background

sf::Sprite HeadBall::InstructionsState::_background
private

Background sprite to draw on the screen

◆ _btnClickSfx

sf::Sound HeadBall::InstructionsState::_btnClickSfx
private

Sound effect for button click.

◆ _data

GameDataRef HeadBall::InstructionsState::_data
private

The shared pointer for all the game data.

◆ _exitBtn

sf::Sprite HeadBall::InstructionsState::_exitBtn
private

Button to exit from the game.

◆ _instructionsText

sf::Text HeadBall::InstructionsState::_instructionsText
private

Text to display instructions information.

◆ ss

std::stringstream HeadBall::InstructionsState::ss
private

String stream to update the controls as in definitions.hpp.


The documentation for this class was generated from the following files: