HeadBall  1.0
A game
GoalState.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 {
14  class GoalState : public State {
15  public:
23  GoalState (GameDataRef data, ScoreTimeRef scoretime, bool isSecondHalf);
28  void init ( );
33  void handleInput ( );
39  void update ( );
44  void draw ( );
45 
46  private:
49 
50  sf::Sound _crowdCheerOnGoal;
51  sf::Sprite _background;
52 
55  };
56 }
Derived class of State class with visibility mode public that checks whether the player has scored go...
Definition: GoalState.hpp:14
void draw()
Draws all the SFML objects of Goal state.
Definition: GoalState.cpp:82
GameDataRef _data
Shared pointer for game data.
Definition: GoalState.hpp:47
sf::Sound _crowdCheerOnGoal
Croud cheering sound.
Definition: GoalState.hpp:50
sf::Sprite _background
Background sprite to draw on the screen.
Definition: GoalState.hpp:51
void update()
Updates the rendering window as per the provided inputs.
Definition: GoalState.cpp:62
void init()
Initialze a new GoalState object.
Definition: GoalState.cpp:11
GoalState(GameDataRef data, ScoreTimeRef scoretime, bool isSecondHalf)
Construct a new Goal State object.
Definition: GoalState.cpp:7
ScoreTimeRef _scoreTime
Shared pointer for score and time.
Definition: GoalState.hpp:48
bool _isSecondHalf
Store whether it is first half or second.
Definition: GoalState.hpp:53
void handleInput()
Handles all the input during goalstate.
Definition: GoalState.cpp:44
int _animationCounter
Counter for animation of movements.
Definition: GoalState.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< 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