#include <ChapterOneState.h>
Public Member Functions | |
| ChapterOneState (sf::RenderWindow &window) | |
| Constructor/Destructor. | |
| ~ChapterOneState () | |
| Handle inputs. | |
| void | update (sf::RenderWindow &window, StateManager &stateManager) override |
| Used for handling input and game updates. | |
| void | render (sf::RenderWindow &window) override |
| Renders current state. | |
Public Member Functions inherited from State | |
| virtual | ~State () |
Public Attributes | |
| std::vector< sf::Texture > * | textures |
| std::vector< std::string > * | filepaths |
| std::vector< sf::Sprite > * | sprites |
| ChapterOneState::ChapterOneState | ( | sf::RenderWindow & | window | ) |
| ChapterOneState::~ChapterOneState | ( | ) |
Handle inputs.
|
overridevirtual |
Renders current state.
player.handlePlayerMovement(map);
Call our update function scene.update();
Clear the window
draw all NPCs(& is used becuase unique_ptr enforces unique ownership)
Draw the scene scene.draw(window); Display the updated window contents
Implements State.
|
overridevirtual |
Used for handling input and game updates.
Need to make this continuous window.getSize() only resizes when the resize is done
window.setView(sf::View(sf::FloatRect(0, 0, static_cast<float>(window.getSize().x), static_cast<float>(window.getSize().y))));
Pause Menu
point to next state
point to player instance
point to textures vector
point to sprites vector
point to filepaths vector
push pointer to next state
Updates
Implements State.
| std::vector<std::string>* ChapterOneState::filepaths |
| std::vector<sf::Sprite>* ChapterOneState::sprites |
| std::vector<sf::Texture>* ChapterOneState::textures |