Pacman Torben Petré
Loading...
Searching...
No Matches
MenuState.h
Go to the documentation of this file.
1#ifndef MENUSTATE_H
2#define MENUSTATE_H
3
4#include <SFML/Graphics/Text.hpp>
5
6#include "StateManager.h"
7
8
9class MenuState final : public State {
10public:
16
28 void handleInput(const sf::Event::KeyEvent &keyPressed) override;
29
33 void resized() override;
34
39 void update(double dt) override;
40
44 void render() override;
45
46private:
47 std::shared_ptr<logic::Score> scoreSystem;
48
49 sf::Sprite pacmanLogo;
50
51 sf::Text highscoresTitle;
52 std::vector<sf::Text> highscores;
53
54 sf::Text username;
55 std::string usernameValue;
56
57 sf::Text cta;
58 bool renderCta = true;
59 double elapsedTime;
60};
61
62
63#endif //MENUSTATE_H
MenuState(StateManager &context)
This State determines the main Pacman game menu.
Definition MenuState.cpp:9
void resized() override
Will resize the contents of the Menu state.
Definition MenuState.cpp:114
void update(double dt) override
Update the MenuState, is used for UI animations.
Definition MenuState.cpp:144
void handleInput(const sf::Event::KeyEvent &keyPressed) override
Will start the game when specific keys are a pressed. Also handles usernames.
Definition MenuState.cpp:45
void render() override
Renders the menu state.
Definition MenuState.cpp:156
State(StateManager &ctx)
Creates the base State object.
Definition StateManager.cpp:4
StateManager & context
Definition StateManager.h:54
Definition StateManager.h:96