HeadBall  1.0
A game
MenuScreen.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 #include "InputManager.hpp"
8 
9 namespace HeadBall {
15  class MenuScreen : public State {
16  public:
22  MenuScreen (GameDataRef data);
23 
28  void init ( );
29 
34  void handleInput ( );
35 
40  void update ( );
41 
46  void draw ( );
47 
48  private:
50  ScoreTimeRef _scoreTime = std::make_shared <ScoreTimeData> ( );
51  sf::Sprite _background;
52  sf::Sprite _playBtn;
53  sf::Sprite _instructionsBtn;
54  sf::Sprite _aboutBtn;
55  sf::Sprite _exitBtn;
56  sf::Music _theme;
57  sf::Text _text;
58  sf::Sound _btnClickSfx;
59  };
60 }
Derived class of State class with visibility mode public that includes the functionality of menuscree...
Definition: MenuScreen.hpp:15
void draw()
Draw all the SFML objects in the rendering window.
Definition: MenuScreen.cpp:142
sf::Sprite _aboutBtn
The sprite object for "About" button.
Definition: MenuScreen.hpp:54
ScoreTimeRef _scoreTime
The shared pointer of ScoreTimeData.
Definition: MenuScreen.hpp:50
sf::Sprite _exitBtn
The sprite object for "exit" button.
Definition: MenuScreen.hpp:55
MenuScreen(GameDataRef data)
Construct a new Menu Screen object.
Definition: MenuScreen.cpp:8
sf::Sprite _instructionsBtn
The sprite object for "Instruction" button.
Definition: MenuScreen.hpp:53
sf::Sprite _background
The sprite object for background of Menu screen.
Definition: MenuScreen.hpp:51
sf::Sound _btnClickSfx
The sound object for sfx while clicking any button.
Definition: MenuScreen.hpp:58
void init()
Initialize a new MenuScreen object.
Definition: MenuScreen.cpp:10
sf::Text _text
The text object for text in Menu screen.
Definition: MenuScreen.hpp:57
sf::Music _theme
The music object for theme music.
Definition: MenuScreen.hpp:56
sf::Sprite _playBtn
The sprite object for "play" button.
Definition: MenuScreen.hpp:52
void handleInput()
Handles the user input in Menu screen.
Definition: MenuScreen.cpp:77
GameDataRef _data
The shared pointer of GameData.
Definition: MenuScreen.hpp:49
void update()
updates the window according to provided input
Definition: MenuScreen.cpp:140
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