EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
ChapterOneState Class Reference

#include <ChapterOneState.h>

Inheritance diagram for ChapterOneState:
State

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
 

Constructor & Destructor Documentation

◆ ChapterOneState()

ChapterOneState::ChapterOneState ( sf::RenderWindow & window)

Constructor/Destructor.

Constructor/Destructor Uses member list initialisation, if not used everything breaks.

you can adjust where the NPCs are placed on the map Create NPCs(5 of them)

NPC

NPC x pos

NPC y pos

Test object

◆ ~ChapterOneState()

ChapterOneState::~ChapterOneState ( )

Handle inputs.

Member Function Documentation

◆ render()

void ChapterOneState::render ( sf::RenderWindow & window)
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.

◆ update()

void ChapterOneState::update ( sf::RenderWindow & window,
StateManager & stateManager )
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.

Member Data Documentation

◆ filepaths

std::vector<std::string>* ChapterOneState::filepaths

◆ sprites

std::vector<sf::Sprite>* ChapterOneState::sprites

◆ textures

std::vector<sf::Texture>* ChapterOneState::textures

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